View Single Post
  #2   Report Post  
Jack Sheet
 
Posts: n/a
Default Delete blank rows Macro


"Richard" wrote in message
...
Using MS Excel 2000.
Help creating a macro please.

I need to search the range A1:A10000 and if the cell is blank I want to
delete the entire row.

Thanks in advance.
--
Richard


Something like

Sub DeleteRowsIfBlank()
Dim lrow as Long
For lRow = 10000 to 1 step -1
If IsEmpty(Range("A"&lrow)) then Range("A"&lrow).Entirerow.Delete
Next lRow
End Sub

Probably not the most efficient code but should work I think. You may want
to specify the worksheet object in which Range resides, for safety.