OptionButton selection dilema

P

Paul

Using XL 2000

I have 10 OptionButtons, assigned to 5 questions. The user
can select either yes or no to each question.

Example...

If Q1; Yes was selected, I require a string to be placed
into Worksheets("Lines").Cells(NewRow, "Z") = "Cr3"

If Q1; No was selected, I require a string to be placed
into Worksheets("Lines").Cells(NewRow, "Z") = "Cr6"

and so on for Q2-Q5

all five Q's are mandatory so I figure bundling them into
a button control would somehow check each for a repsonse,
any ideas on this procedure would be bonus.

Any suggestion appreciated. Many thanks

Paul
 
T

Tom Ogilvy

In a general module
Public NewRow as Long

somewhere you set the value of New Row

then in the module associated with the worksheet or userform:

Private Sub OptionButton1_Click()
if OptionButton1.Value then
Worksheets("Lines").Cells(NewRow, "Z") = "Cr3"
End if
End Sub

Private Sub OptionButton2_Click()
if OptionButton2.Value then
Worksheets("Lines").Cells(NewRow, "Z") = "Cr6"
End if
End Sub

You should use the groupname property of the option buttons to put each pair
in a separate group. Name chosen is immaterial; it should just be unique to
the pair.
 
Top