Sub Lime()
For col = 1 To ActiveSheet.UsedRange.Columns.Count
If WorksheetFunction.Count(Columns(col)) = 0 Then
Columns(col).EntireColumn.Hidden = True
End If
Next
End Sub
Sub HideNonNumericColumns()
Dim X As Long, WS As Worksheet
Set WS = ActiveSheet
For X = 1 To WS.UsedRange.Columns.Count
If Join(WorksheetFunction.Transpose(WS.UsedRange.Columns(X)), "") _
Like "*[!0-9]*" Then WS.Columns(X).Hidden = True
Next
End Sub
If you dont have formulas in the range...the below will do..Will hide
columns which contain text..
Sub ColHide()
For Each Col In ActiveSheet.UsedRange.Columns
If WorksheetFunction.CountIf(Columns(Col.Column), "?*") <> 0 Then
Col.EntireColumn.Hidden = True
End If
Next
End Sub
Sub ColHide()
For Each ws in Worksheets
With ws
For Each Col In ws.UsedRange.Columns
If WorksheetFunction.CountIf(ws.Columns(Col.Column), "?*") <> 0 Then
Col.EntireColumn.Hidden = True
End If
Next
End With
Next
End Sub