Reputation: 23
I have a few checkboxes , based on the "True" or "False" logic of the checkboxes , I would like to navigate to different "Sheets" in a same workbook. Please Help in writing a VBA code !!
I have written the following code,But I get a "OBJECT" error.
If CheckBox1.Value = True And CheckBox2.Value = True Then Sheets("abc").Range("A3").Select
Upvotes: 2
Views: 68
Reputation: 149325
I feel you are using form controls.
Try this for me.
Dim cbOne As Shape, cbTwo As Shape
Set cbOne = ActiveSheet.Shapes("Check Box 1")
Set cbTwo = ActiveSheet.Shapes("Check Box 2")
If cbOne.OLEFormat.Object.Value = 1 And cbTwo.OLEFormat.Object.Value = 1 Then
'
'~~> Do what you want
'
End If
Upvotes: 1