Survey Form

G

Guest

Hello,

I want to take a poll with approx 5 answer options displayed as radio
buttons or check marks. i.e. Options are Monday, Tuesday, Wednesday,
Thursday, Friday, When all users answer, I want to paste answers into one
spreadsheet then look at
activity X and count how many answered Monday, Tuesday, Wednesday, Thursday,
Friday. Any suggestions on how to start would be great.

Just remeber that I'll be sending the workbook as an attachment via email to
everyone. I would like to make it's as simple as possible for them to open
answer and resend back to me. Thank you.

John
 
M

moondark

Hi,

I created a Spreadsheet with the name "Start" and added 5 Optionbutton
named "Choice1" to Choice"5" and a commandbutton to execute the code an
to vote.

The following code works but I'm not absolutely sure if it fits you
needs

Code
-------------------
Private Sub CommandButton1_Click()
'Check if Spreadsheet "Result" exists
newone = True
For Each s In Sheets
If s.Name = "Result" Then newone = False
Next s
'if there's not such a sheet create it
If newone = True Then
Set ResultSheet = ActiveWorkbook.Worksheets.Add
ResultSheet.Name = "Result"
End If
'activate the sheet
Sheets("Result").Activate

'Fill in the values of the OptionButtons Where true = -1 and False = 0 _
so you have to subtract the value
Sheets("Result").Cells(1, 1) = Sheets("Result").Cells(1, 1) - Sheets("Start").Choice1.Value
Sheets("Result").Cells(2, 1) = Sheets("Result").Cells(2, 1) - Sheets("Start").Choice2.Value
Sheets("Result").Cells(3, 1) = Sheets("Result").Cells(3, 1) - Sheets("Start").Choice3.Value
Sheets("Result").Cells(4, 1) = Sheets("Result").Cells(4, 1) - Sheets("Start").Choice4.Value
Sheets("Result").Cells(5, 1) = Sheets("Result").Cells(5, 1) - Sheets("Start").Choice5.Value


End Su
-------------------


it's rather simple and therefore not dynamic (,yet).
But I preferred plain code, you can learn from ;)

The code creates a Sheet called "Result" if it doesnt exist and write
the values of the optionbuttons in Cells A1 to A5. I didnt work o
Headlines a.s.o. because everyone has his own design :)
You could also add a code fragment that checks if there is a
optionbutton selected (if not then msgbox("alert"))
something like that.


Regards,

Simo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top