nbqleebarnes
12-05-2011, 12:55 AM
Hi All,
Been a long time since here,
anyway I picked up on the following code that hides empty columns, I would like to know if there is a way to do this with rows.
Thanks
Lee
Sub Button1_Click()
Dim Col_Ct As Integer, i As Integer
Col_Ct = Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To Col_Ct
If WorksheetFunction.CountA(Range(Cells(1, i).Address, Cells(Rows.Count, i).Address)) < 2 Then
Cells(1, i).EntireColumn.Hidden = True
End If
Next i
End Sub
Been a long time since here,
anyway I picked up on the following code that hides empty columns, I would like to know if there is a way to do this with rows.
Thanks
Lee
Sub Button1_Click()
Dim Col_Ct As Integer, i As Integer
Col_Ct = Cells(1, Columns.Count).End(xlToLeft).Column
For i = 1 To Col_Ct
If WorksheetFunction.CountA(Range(Cells(1, i).Address, Cells(Rows.Count, i).Address)) < 2 Then
Cells(1, i).EntireColumn.Hidden = True
End If
Next i
End Sub