Assign Value to OptionBotton then transfer to spreadsheet

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
 
B

Bob Phillips

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)
 
Top