User Form - option buttons

A

anthony slater

I've made a simple data entry user form that upon clicking
a command button ('OK'), puts the values in various places
in my worksheet.

The userform also has two option buttons.

On my worksheet, I have two option buttons. How can I link
the option buttons on the user form to the option buttons
on the worksheet?

ie, when a Userform option button is selected, the
worksheet option button is also selected (upon clicking
the command (OK) button

Hope I explained this well
 
M

Mauro Gamberini

Private Sub CommandButton1_Click()

With Sheet1

If OptionButton1.Value = True Then
.OptionButton1.Value = True
.OptionButton2.Value = False
ElseIf OptionButton2.Value = True Then
.OptionButton1.Value = False
.OptionButton2.Value = True
Else
.OptionButton1.Value = False
.OptionButton2.Value = False
End If

End With

End Sub
 
Top