Pman, if you're trying to leave only one blank row in at a time try something
like this:
Dim cnt as Long
Dim MyCell as Range
For cnt = 503 to 2 Step -1
Set MyCell = Range("B" & cnt)
If MyCell = "" and MyCell.Offset(-1) = "" Then MyCell.EntireRow.Delete
Next

Signature
Charles Chickering
"A good example is twice the value of good advice."
> Hi,
>
[quoted text clipped - 27 lines]
>
> P
Joel - 27 Sep 2007 03:22 GMT
Your problem is finding the last row of data. Use this statement
Lastrow = cells(rows.count,"A").end(xlup).Row
row.count is an excel constant which is 65536.
end(xlup) move from 65536 to the first non empty cell
You can then modify your loop
for i = 2 to LastRow
next i
> Pman, if you're trying to leave only one blank row in at a time try something
> like this:
[quoted text clipped - 36 lines]
> >
> > P
Charles Chickering - 27 Sep 2007 04:11 GMT
I'm well aware of the .End(xlUp) function. The OP stated that he had 503 rows
to deal with, therefore no need for the extra processing time of finding the
last used row. Furthermore, .End(xlUp) only works if all rows are visible.
Taking this one step further, we're deleting rows so if we work from row 2 to
the end we will end up skipping rows causing the OP further problems. When
deleting rows you should always work from the bottom up.

Signature
Charles Chickering
"A good example is twice the value of good advice."
> Your problem is finding the last row of data. Use this statement
>
[quoted text clipped - 49 lines]
> > >
> > > P
Joel - 27 Sep 2007 04:23 GMT
You are fixing the wrong problem. Look a again at the data. He is putting
the row with TOTAL at row 504 even if there is on 20 rows of data. He simply
wants to put the row containing TOTAL at the end of the list. The blank rows
he is trying to eliminate is between the end of the data and the row with
TOTAL.
> I'm well aware of the .End(xlUp) function. The OP stated that he had 503 rows
> to deal with, therefore no need for the extra processing time of finding the
[quoted text clipped - 56 lines]
> > > >
> > > > P
Pman - 27 Sep 2007 15:27 GMT
Thank you Charles :)
It worked for me :)
> Pman, if you're trying to leave only one blank row in at a time try something
> like this:
[quoted text clipped - 36 lines]
> >
> > P