Hi guys,
I've put together some macros to hide rows and columns using an ActiveX Checkbox. They work fine but I'm trying to add to them so they also hide a worksheet. An example macro is below.
Cell B10 of the sheet containing the macro has a name that corresponds to the name of another worksheet. I want the checkbox to hide that sheet but I'm struggling to get the reference right.
Can anyone point me in the right direction?
Thanks
I've put together some macros to hide rows and columns using an ActiveX Checkbox. They work fine but I'm trying to add to them so they also hide a worksheet. An example macro is below.
Cell B10 of the sheet containing the macro has a name that corresponds to the name of another worksheet. I want the checkbox to hide that sheet but I'm struggling to get the reference right.
Can anyone point me in the right direction?
Thanks
VBA Code:
Private Sub CheckBox1_Click()
Application.ScreenUpdating = False
If CheckBox1 = False Then
[10:10].EntireRow.Hidden = True
Else:
[10:10].EntireRow.Hidden = False
End If
If CheckBox1 = False Then
Sheets("Matrix").[7:7].EntireRow.Hidden = True
Else:
Sheets("Matrix").[7:7].EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub