mattstan2012
New Member
- Joined
- May 23, 2024
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Hi
I have managed to find the following which allows me to toggle between showing and hiding a specific column using a toggle button a and VGA:
Private Sub ViewHideLunches_Click()
Dim MyC As String
MyC = "C:D"
If ViewHideLunches.Value Then
Application.ActiveSheet.Columns(MyC).Hidden = True
Else
Application.ActiveSheet.Columns(MyC).Hidden = False
End If
End Sub
It works ace for hiding columns C & D, but I need to also hide C&D, H&I, M&N etc etc but I can't get it to do this.
I thought having MyC = "C:D","H:I","M:N" etc would work but, of course, it doesn't.
Any suggestions?
I have managed to find the following which allows me to toggle between showing and hiding a specific column using a toggle button a and VGA:
Private Sub ViewHideLunches_Click()
Dim MyC As String
MyC = "C:D"
If ViewHideLunches.Value Then
Application.ActiveSheet.Columns(MyC).Hidden = True
Else
Application.ActiveSheet.Columns(MyC).Hidden = False
End If
End Sub
It works ace for hiding columns C & D, but I need to also hide C&D, H&I, M&N etc etc but I can't get it to do this.
I thought having MyC = "C:D","H:I","M:N" etc would work but, of course, it doesn't.
Any suggestions?