Prajwal k.s.
Prajwal k.s.

Reputation: 23

How to Use CheckBox Logic to navigate other sheets in a workbook?

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

Answers (1)

Siddharth Rout
Siddharth Rout

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

Related Questions