TimvMechelen
Board Regular
- Joined
- Nov 7, 2016
- Messages
- 121
Hi all,
I have the code below now, but when I manually hide a column (for example column C) and use the toggle button twice, column C is visible again and I want it to stay hidden. Is there a possibility to do that?
I have the code below now, but when I manually hide a column (for example column C) and use the toggle button twice, column C is visible again and I want it to stay hidden. Is there a possibility to do that?
Code:
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "A:Z"
If ToggleButton1.Value Then
Application.ActiveSheet.Columns(xAddress).Hidden = True
Else
Application.ActiveSheet.Columns(xAddress).Hidden = False
End If
End Sub