View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Delete blank rows

Try this small macro:

Sub rowkiller()
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = n To 1 Step -1
If IsEmpty(Cells(i, 1)) Then
Rows(i).Delete
End If
Next
End Sub
--
Gary''s Student - gsnu200807


"Charlotte Howard" wrote:

Hello,
I'm returning some address lines into separate cells, some of which will be
blank.
Is it possible to delete the blank lines using some form of macro?

Cells A1:A6 contain the data. Cell A2 will always be populated, but the
remaining 5 can be blank
Sample
A1 - Address line 1
A2 -
A3 - Town
A4 -
A5 -
A6 - County

In this sample I would like rows 2, 4 & 5 to be deleted, returning
A1 - Address line 1
A3 - Town
A6 - County

Thanks for any help on this one