G
Guest
Something is wrong with the OR statement on the line with the asterisks. I
want to hide the columns that have all n/a's as the only data cells. There
could be some blanks also but otherwise no data. Also, I was trying to debug
it and see what column it was counting. I can't tell if it works since my OR
statement is wrong.
tia,
For Each C In Intersect(Range("12:64000"), ActiveSheet.UsedRange).Columns
** If Application.CountIf(C.Cells, "n/a" Or " ") = C.Cells.Count Then ***
C.EntireColumn.Hidden = True
C.columnIndex = colIndex
Debug.Print colIndex
Else
C.EntireColumn.Hidden = False
End If
Next C
Application.ScreenUpdating = True
End Sub
want to hide the columns that have all n/a's as the only data cells. There
could be some blanks also but otherwise no data. Also, I was trying to debug
it and see what column it was counting. I can't tell if it works since my OR
statement is wrong.
tia,
For Each C In Intersect(Range("12:64000"), ActiveSheet.UsedRange).Columns
** If Application.CountIf(C.Cells, "n/a" Or " ") = C.Cells.Count Then ***
C.EntireColumn.Hidden = True
C.columnIndex = colIndex
Debug.Print colIndex
Else
C.EntireColumn.Hidden = False
End If
Next C
Application.ScreenUpdating = True
End Sub