I suggest you use the UsedRange method to determine the size of the
data and the End method to jump to the last row. Then use the
Range(Ax,Ay) followed by EntireRow and then set the property Hidden to
True.
Here is the Visual Basic code:
Sub HideEmptyRows()
Dim EmptyRow As Integer
EmptyRow = ActiveSheet.UsedRange.Rows.Count + 1
Range(Cells(EmptyRow, 1), Cells(EmptyRow,
1).End(xlDown)).EntireRow.Hidden = True
End Sub
You can simplify the process in LV by using result from the
UsedRange.Rows.Count as an integer, add 1, and then feed a string
formatted as "Axxx" into the Cells(EmptyRow,1) parameters for the
Range.
Michael
www.abcdefirm.com