i have a similar problem, since i have to count how many
rows are in a worksheet *with anything* in them and
include the rows that have *nothing* and are in between
the other occupied rows. the thing is that i have to
delete the rows in blank and only leave the occupied rows
here´s what i do but it only works if there´s just one row
unused:
ActiveCell.CurrentRegion.Select
a = Selection.Rows.Count
Do While Cells(a + 2, 3) <> ""
ActiveCell.CurrentRegion.Select
a = Selection.Rows.Count
If (Cells(a + 1, 3) = "") Then
Cells(a + 1, 3).Select
Selection.EntireRow.Delete shift:=xlUp
End If
Loop
i think the trick is in the condition, what do you think?