Need macro to remove blank rows
This is ALMOST given in the Excel help file
Set currentCell = Worksheets("Sheet1").Range("H2")
for each cell in range("H2:H1000")
Set nextCell = currentCell.Offset(1, 0)
If Len(currentCell.Value)=0 Then
currentCell.EntireRow.Delete
End If
Set currentCell = nextCell
Next
Bob wrote:
I have a 1-column spreadsheet that contains data in column H. Some rows in
column H contain no data (i.e., its blank). I need help in writing a macro
that, starting with cell H2, will examine each cell in column H and
automatically delete a row where no data exists. The macro would terminate
after reaching row 1000.
I would greatly appreciate any help. Thanks.
Bob
|