Hi all,
I have an Excel sheet whith 2 sheets called Sheet1 and Sheet 2.
I added a checkbox to the sheet 2 and would like it to work like this:
1) When the checkbox is checked the Sheet1 becomes hidden
2) When the checkbox is un-checked the Sheet1 becomes visible
I wrote the code below but I keep getting the "run-time error 424 Object required" error. Please help me with that if possible. Thanks.
Private Sub CheckBox1_Click ()
If CheckBox1.Value = True Then
Sheet1.Visible = xlSheetHidden
Else
Sheet1.Visible = xlSheetVisible
End If
End Sub
I have an Excel sheet whith 2 sheets called Sheet1 and Sheet 2.
I added a checkbox to the sheet 2 and would like it to work like this:
1) When the checkbox is checked the Sheet1 becomes hidden
2) When the checkbox is un-checked the Sheet1 becomes visible
I wrote the code below but I keep getting the "run-time error 424 Object required" error. Please help me with that if possible. Thanks.
Private Sub CheckBox1_Click ()
If CheckBox1.Value = True Then
Sheet1.Visible = xlSheetHidden
Else
Sheet1.Visible = xlSheetVisible
End If
End Sub
Comment