Detect whether a row is completely empty

C

Cor Steeghs

I would appreciate any of your help in the following:
How can it be detected whether all cells in a row are completely empty?
In this case I want to delete empty rows.
Thanks very much for your attention and/or reply and best regards,
Cor Steeghs
 
S

steve

Cor,

Dim x as Long
Dim lrow as Long

lrow = Cells(Rows.COUNT, "A").End(xlUp).Offset(1, 0).Row
' determine number of rows

For x = lrow to 1 step -1
If Worksheetfunction.Counta(Rows(x)) = 0 then
Rows(x).EntireRow.Delete
End if
Next

steve
 
T

Tom Ogilvy

for i = 10 to 1 step -1
if application.CountA(cells(i,1).EntireRow) = 0 then
cells(i,1).EntireRow.Delete
end if
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top