G
Guest
Thank you Bernie for the hidecolumn macro. It is easier to read, there is
still a problem however, it doesn't hide any columns.
I know this macro should work but it doesn't. I checked the worksheet
properties, read-only or hidden is not checked. I checked options and there
is nothing under security. I even unfiltered the columns thinking it
wouldn't hide the filtered ones. Why isn't it hiding the columns with n/a.
Could it be it doesn't like the slash and I have to escape it when it
searches for the string n/a ?
Public Sub FORMAT_VOD_HideColumns()
Dim C As Range
Application.ScreenUpdating = False
For Each C In Intersect(Range("12:64000"), ActiveSheet.UsedRange).Columns
If Application.CountIf(C.Cells, "N/A") = C.Cells.Count Then
C.EntireColumn.Hidden = True
Else
C.EntireColumn.Hidden = False
End If
Next C
Application.ScreenUpdating = True
End Sub
What am I missing?
tia,
still a problem however, it doesn't hide any columns.
I know this macro should work but it doesn't. I checked the worksheet
properties, read-only or hidden is not checked. I checked options and there
is nothing under security. I even unfiltered the columns thinking it
wouldn't hide the filtered ones. Why isn't it hiding the columns with n/a.
Could it be it doesn't like the slash and I have to escape it when it
searches for the string n/a ?
Public Sub FORMAT_VOD_HideColumns()
Dim C As Range
Application.ScreenUpdating = False
For Each C In Intersect(Range("12:64000"), ActiveSheet.UsedRange).Columns
If Application.CountIf(C.Cells, "N/A") = C.Cells.Count Then
C.EntireColumn.Hidden = True
Else
C.EntireColumn.Hidden = False
End If
Next C
Application.ScreenUpdating = True
End Sub
What am I missing?
tia,