Hello I hope you all can help.
Sheet1 contains an activeX control (checkbox) which once ticked, columns H:M in all sheets sheet2, sheet3, sheet4, sheet5 will hide themselves (and when unticked, reveal themselves)
The VBA used (from another thread) is:
Sub ShowHideColumns()
'Assuming Checkbox 1 is a form control and named "Check Box 1"
Dim b As Boolean
'record if the control is ticked
b = Sheet1.Shapes("Check Box 1").ControlFormat.Value = 1
Sheet2.Range("H1:M1").EntireColumn.Hidden = b
Sheet3.Range("H1:M1").EntireColumn.Hidden = b
Sheet4.Range("H1:M1").EntireColumn.Hidden = b
Sheet5.Range("H1:M1").EntireColumn.Hidden = b
End Sub
Unfortunately, I would like to lock cells A1:G7, as well as N1:AP7 (protect cells and then protect sheet with password).
When I do so, the VBA no longer works (Despite the columns H:M not being locked, so I thought this would work)
Is there anyway I can make this work?
Thanks
Sheet1 contains an activeX control (checkbox) which once ticked, columns H:M in all sheets sheet2, sheet3, sheet4, sheet5 will hide themselves (and when unticked, reveal themselves)
The VBA used (from another thread) is:
Sub ShowHideColumns()
'Assuming Checkbox 1 is a form control and named "Check Box 1"
Dim b As Boolean
'record if the control is ticked
b = Sheet1.Shapes("Check Box 1").ControlFormat.Value = 1
Sheet2.Range("H1:M1").EntireColumn.Hidden = b
Sheet3.Range("H1:M1").EntireColumn.Hidden = b
Sheet4.Range("H1:M1").EntireColumn.Hidden = b
Sheet5.Range("H1:M1").EntireColumn.Hidden = b
End Sub
Unfortunately, I would like to lock cells A1:G7, as well as N1:AP7 (protect cells and then protect sheet with password).
When I do so, the VBA no longer works (Despite the columns H:M not being locked, so I thought this would work)
Is there anyway I can make this work?
Thanks