User Form - option buttons

  • Thread starter Thread starter anthony slater
  • Start date Start date
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
 
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
 

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

Back
Top