Hi, I have a form control button called "Hide Col" that runs the code below. I would like to make the button toggle to hide and unhide. I tried to implement some code that I searched online but I'm unable to do it correctly. Also, I see it's possible to have the control button name change as well. So could we have it say "Hide Col" and then ""show Col" ? Thanks in advance
Code:
Sub DETAIL_FORM_HIDE_COL()
Dim c As Range
For Each c In Range("I12:Z12").Cells
If c.Value = "HIDE" Then
c.EntireColumn.Hidden = True
End If
Next c
End Sub
Last edited: