Hello,
I created two radio buttons on a spreadsheet where a user can select
one button for Yes and the other for No. When I right click these
buttons, I notice the names (shown on the left hand side of the
formula bar) are:
Option Button 3 (for No)
Option Button 4 (for Yes)
I'd like to create a macro that automatically selects the Yes or No
button depending on a cell value in another tab. If the cell value is
1, the macro should select Yes. If the value is 0 the macro should
select No.
I tried running the macro below:
Sub testSelectYesOrNo()
If Not IsEmpty(Sheets("Sheet2").Range("A1").Value) Then
Select Case Sheets("Sheet2").Range("A1").Value
Case Is = 1
Sheets("Sheet1").OptionButton4 = True
Case Is = 0
Sheets("Sheet1").OptionButton3 = True
End Select
End If
End Sub
But when this runs I get a "Run-time error 438 Object doesn't support this property or method"
When I click debug, the text "Sheets("Sheet1").OptionButton4 = True"
was highlighted.
Please help! Thanks...
I created two radio buttons on a spreadsheet where a user can select
one button for Yes and the other for No. When I right click these
buttons, I notice the names (shown on the left hand side of the
formula bar) are:
Option Button 3 (for No)
Option Button 4 (for Yes)
I'd like to create a macro that automatically selects the Yes or No
button depending on a cell value in another tab. If the cell value is
1, the macro should select Yes. If the value is 0 the macro should
select No.
I tried running the macro below:
Sub testSelectYesOrNo()
If Not IsEmpty(Sheets("Sheet2").Range("A1").Value) Then
Select Case Sheets("Sheet2").Range("A1").Value
Case Is = 1
Sheets("Sheet1").OptionButton4 = True
Case Is = 0
Sheets("Sheet1").OptionButton3 = True
End Select
End If
End Sub
But when this runs I get a "Run-time error 438 Object doesn't support this property or method"
When I click debug, the text "Sheets("Sheet1").OptionButton4 = True"
was highlighted.
Please help! Thanks...