Hello
I'm using Excel 2010. I currently have a button on each worksheet of my workbook which runs the following code to hide/show columns. Is there any way that I can take this code and add it as a toggle on the toolbar so whatever worksheet the user is in it will show/hide as applicable?
Thanks very much.
I'm using Excel 2010. I currently have a button on each worksheet of my workbook which runs the following code to hide/show columns. Is there any way that I can take this code and add it as a toggle on the toolbar so whatever worksheet the user is in it will show/hide as applicable?
Code:
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = False Then
Me.Unprotect
Range("B1:J1").EntireColumn.Hidden = False
ToggleButton1.Caption = "Hide Original"
Me.Protect
Else
Me.Unprotect
Range("B1:J1").EntireColumn.Hidden = True
ToggleButton1.Caption = "Show Original"
Me.Protect
End If
End Sub
Thanks very much.