Public Sub CheckBox1Routine()
Application.ScreenUpdating = False
If ActiveSheet.Shapes("Check Box 1").ControlFormat.Value = xlOn Then
Sheet4.Select
Sheet4.Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Else
Sheet4.Select
Sheet4.Columns("B:B").Select
Selection.EntireColumn.Hidden = True
End If
Sheet3.Select
Application.ScreenUpdating = True
End Sub
Public Sub CheckBox1Routine()
Application.ScreenUpdating = False
If ActiveSheet.Shapes("Check Box 1").ControlFormat.Value = xlOn Then
Sheet4.Columns("B:B").EntireColumn.Hidden = False
Else
Sheet4.Columns("B:B").EntireColumn.Hidden = True
End If
Sheet3.Select
Application.ScreenUpdating = True
End Sub
Public Sub CheckBox1Routine()
Application.ScreenUpdating = False
Sheet4.Columns("B:B").EntireColumn.Hidden = (ActiveSheet.Shapes("Check Box 1").ControlFormat.Value <> xlOn)
Sheet3.Select
Application.ScreenUpdating = True
End Sub
Sub AllCheckBox()
Dim ColToHide as Range
With Sheet4
Select Case Application.Caller
Case "Check Box 1"
Set ColToHide = .Range("B:B")
Case "Check Box 2"
Set ColToHide = .Range("C:C")
Case "Check Box 3"
Set ColToHide = .Range("D:D")
End Select
End With
ColToHide.EntireColumn.Hidden = (ActiveSheet.Shapes(Application.Caller).ControlFormat.Value <> xlOn)
End Sub
Sub AllCheckBox2()
Dim ColToHide as Range
Dim BoxIndex as Long
BoxIndex = Val(Right(Application.Caller, 2))
Set ColToHide = Sheet4.Columns(BoxIndex + 1)
ColToHide.EntireColumn.Hidden = (ActiveSheet.Shapes(Application.Caller).ControlFormat.Value <> xlOn)
End Sub