PDA

View Full Version : [SOLVED] Option Button Value



Svmaxcel
10-15-2017, 10:00 PM
I have 2 option buttons caption as Yes,No.
They are under a frame called Incomplete Troubleshooting.
At the end is a command button to save it to worksheet.
I have made Option Button "No" as True by default.
I want to get result in my sheet as Yes/No
Example
If user clicks on OButton Yes, and clicks on Save, I should get Yes in my sheet.

Jan Karel Pieterse
10-16-2017, 02:42 AM
If these are option buttons on a worksheet then you can simply tie them to a cell directly.

Svmaxcel
10-16-2017, 02:57 AM
These are on userform

Jan Karel Pieterse
10-16-2017, 03:07 AM
Simple enough:

If OptionButton1.Value Then
Worksheets("Sheet1").Range("A1").Value = "Yes"
Else
Worksheets("Sheet1").Range("A1").Value = "No"
End If