Comments on: How can I tally individual votes when the SharePoint survey combines multiple choice selections as a single vote? http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/ No GeekSpeak on SharePoint 2007 WSS and MOSS Thu, 10 Jun 2010 04:22:02 -0400 http://wordpress.org/?v=2.8.6 hourly 1 By: Michael http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-44900 Michael Fri, 12 Mar 2010 15:09:33 +0000 http://www.endusersharepoint.com/?p=68#comment-44900 This may not be the cleanest method of reviewing results, but I have come up with an Excel macro that will break apart all questions on a survey and give you the results. All you have to do is Export to Spreadsheet your results and run this macro. I have stored the macro in my personal macros so it is always available. Below is the macro. Please let me know what you think. Michael Kepley [sourcecode lang="javascript"] Sub UpdateSurvey() Dim counter As Integer Dim row As Integer Dim row_answer As Integer Dim question As String Dim answer As String Dim answer_whole As String Dim answer_find As Integer Dim check As String Dim start_here As Integer Dim rfound As Range counter = 1 question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value Do While question "" sheetname = "Question " + CStr(counter) On Error Resume Next Worksheets(sheetname).Activate If Err.Number = 0 Then Application.DisplayAlerts = False Worksheets(sheetname).Delete Application.DisplayAlerts = True End If On Error GoTo 0 Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = sheetname Worksheets(sheetname).Range("A1").Value = Worksheets(1).Range("A1").Offset(0, counter + 1).Value row = 1 row_answer = 1 check = Worksheets(1).Range("A1").Offset(row, 0).Value Do While check "" answer_find = 1 start_here = 1 answer_whole = Worksheets(1).Range("A1").Offset(row, counter + 1).Value Do While answer_find 0 answer_find = InStr(start_here, answer_whole, ";#") If answer_find = 0 Then answer = Mid(answer_whole, start_here) Else answer = Mid(answer_whole, start_here, answer_find - start_here) End If On Error Resume Next Worksheets(sheetname).Columns("B:B").Select Set rfound = Selection.Find(What:=answer, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) If Not rfound Is Nothing Then rfound.Offset(0, 1).Value = rfound.Offset(0, 1).Value + 1 Else Worksheets(sheetname).Range("A1").Offset(row_answer, 0).Value = row_answer Worksheets(sheetname).Range("A1").Offset(row_answer, 1).Value = "'" + answer Worksheets(sheetname).Range("A1").Offset(row_answer, 2).Value = 1 row_answer = row_answer + 1 End If On Error GoTo 0 start_here = answer_find + 2 Loop row = row + 1 check = Worksheets(1).Range("A1").Offset(row, 0).Value Loop Worksheets(sheetname).Columns("B:C").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers counter = counter + 1 question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value Loop End Sub [/sourcecode] This may not be the cleanest method of reviewing results, but I have come up with an Excel macro that will break apart all questions on a survey and give you the results. All you have to do is Export to Spreadsheet your results and run this macro. I have stored the macro in my personal macros so it is always available. Below is the macro. Please let me know what you think.

Michael Kepley

Sub UpdateSurvey()

Dim counter As Integer
Dim row As Integer
Dim row_answer As Integer
Dim question As String
Dim answer As String
Dim answer_whole As String
Dim answer_find As Integer
Dim check As String
Dim start_here As Integer
Dim rfound As Range

counter = 1
question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value

Do While question  ""

    sheetname = "Question " + CStr(counter)

    On Error Resume Next
    Worksheets(sheetname).Activate

    If Err.Number = 0 Then
        Application.DisplayAlerts = False
        Worksheets(sheetname).Delete
        Application.DisplayAlerts = True
    End If
    On Error GoTo 0
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = sheetname
    Worksheets(sheetname).Range("A1").Value = Worksheets(1).Range("A1").Offset(0, counter + 1).Value
    row = 1
    row_answer = 1
    check = Worksheets(1).Range("A1").Offset(row, 0).Value

    Do While check  ""

        answer_find = 1
        start_here = 1
        answer_whole = Worksheets(1).Range("A1").Offset(row, counter + 1).Value
        Do While answer_find  0
            answer_find = InStr(start_here, answer_whole, ";#")
            If answer_find = 0 Then
                answer = Mid(answer_whole, start_here)
            Else
                answer = Mid(answer_whole, start_here, answer_find - start_here)
            End If
            On Error Resume Next
            Worksheets(sheetname).Columns("B:B").Select
            Set rfound = Selection.Find(What:=answer, LookIn:=xlFormulas, _
                LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                MatchCase:=False, SearchFormat:=False)
            If Not rfound Is Nothing Then
                rfound.Offset(0, 1).Value = rfound.Offset(0, 1).Value + 1
            Else
                Worksheets(sheetname).Range("A1").Offset(row_answer, 0).Value = row_answer
                Worksheets(sheetname).Range("A1").Offset(row_answer, 1).Value = "'" + answer
                Worksheets(sheetname).Range("A1").Offset(row_answer, 2).Value = 1
                row_answer = row_answer + 1
            End If
            On Error GoTo 0

            start_here = answer_find + 2
        Loop
        row = row + 1
        check = Worksheets(1).Range("A1").Offset(row, 0).Value

    Loop

    Worksheets(sheetname).Columns("B:C").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortTextAsNumbers
    counter = counter + 1
    question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value

Loop

End Sub
]]>
By: surendra singh http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-11432 surendra singh Thu, 19 Mar 2009 14:08:28 +0000 http://www.endusersharepoint.com/?p=68#comment-11432 Hi, How to Change message "You are not allowed to respond again to this survey. " Sharepoint survey list Thanks Surendra Hi,

How to Change message

“You are not allowed to respond again to this survey. ”

Sharepoint survey list

Thanks
Surendra

]]>
By: Sachin http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-8703 Sachin Thu, 04 Dec 2008 09:21:08 +0000 http://www.endusersharepoint.com/?p=68#comment-8703 Hi My survey is having more than one multiple choice questions. Here you suggested to create a custom list for one question. So far more than one questions, should we extrapolate this approach? Should we create one custom list per question? Hi

My survey is having more than one multiple choice questions. Here you suggested to create a custom list for one question. So far more than one questions, should we extrapolate this approach? Should we create one custom list per question?

]]>
By: EndUserSharePoint http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-8000 EndUserSharePoint Tue, 21 Oct 2008 13:36:42 +0000 http://www.endusersharepoint.com/?p=68#comment-8000 Joseph - Move your question to Stump the Panel and it will get more exposure. This thread is almost a year old. Regards, Mark Joseph – Move your question to Stump the Panel and it will get more exposure. This thread is almost a year old.

Regards,
Mark

]]>
By: Joseph http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-7993 Joseph Mon, 20 Oct 2008 23:35:31 +0000 http://www.endusersharepoint.com/?p=68#comment-7993 I have a poll question with 100+ choices. When creating a Survey I can copy and paste the choices from a spreadsheet. With the workaround, I don't want to manually create the columns one by one. Is there an easy way to do that in batch? I have a poll question with 100+ choices. When creating a Survey I can copy and paste the choices from a spreadsheet. With the workaround, I don’t want to manually create the columns one by one. Is there an easy way to do that in batch?

]]>
By: Heath Castle http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-655 Heath Castle Wed, 16 Jan 2008 15:55:56 +0000 http://www.endusersharepoint.com/?p=68#comment-655 I have been looking into this for hours. Excellent workaround. Thanks. I have been looking into this for hours. Excellent workaround. Thanks.

]]>
By: Mark Miller http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-471 Mark Miller Fri, 07 Dec 2007 19:50:50 +0000 http://www.endusersharepoint.com/?p=68#comment-471 Thanks, Janis. I've also done the same regarding your post on when to create libraries. Let's keep in touch. Mark Thanks, Janis. I’ve also done the same regarding your post on when to create libraries. Let’s keep in touch.

Mark

]]>
By: Janis Hall http://www.endusersharepoint.com/2007/11/29/how-can-i-tally-individual-votes-when-the-sharepoint-survey-combines-multiple-choice-selections-as-a-single-vote/comment-page-1/#comment-469 Janis Hall Fri, 07 Dec 2007 15:38:55 +0000 http://www.endusersharepoint.com/?p=68#comment-469 Great tips! I plan to reference your blogs to my students :) Great tips! I plan to reference your blogs to my students :)

]]>