Gregg Wolin
Member
I'd like to toggle the visibility of columns based on values in a header row where the cells either have a 0 or 1. I use the following code (to hide) that works - but its SLOW (on a fast machine). It also doesn't deal with the unhide part of the toggle (which i held off trying until i figured out the speed thing).
Any thoughts would be appreciated
Code:
Sub Toggle_ZeroColumnsMonthly()
Dim c As Range
For Each c In Range("a1:nd1").Cells
If c.Value = "0" Then
c.EntireColumn.Hidden = True
Else
c.EntireColumn.Hidden = False
End If
Next c
End Sub
Any thoughts would be appreciated