Assign Value to OptionBotton then transfer to spreadsheet

  • Thread starter Thread starter Excel Nerd
  • Start date Start date
E

Excel Nerd

Hello all,

I need a general education on how to program an OptionButton.

I have created a userform in visual basic. It has a frame with
option buttons. One of which, specifies "Other", and has a textbox fo
user input.


What code is needed to:
1. Assign a value to each option button
2. Have the value assigned put into
ThisWorkbook.Sheets("Masterlist").Range("d2") - if the option i
selected

Please help...
Excel Nerd:confused
 
Optionbuttons cannot be assigned values per se, they can only be on or off.
You could check it when pressed and set the value that way

Private Sub OptionButton1_Click()
If Me.OptionButton1.Value Then
Range("B1").Value = "Button off"
End If
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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