A
andycharger
Im writing a fiddly macro that seems to have a few problems with blan
rows.
Basically, my code is cycling through the rows in a spreadsheet an
deleting certain rows.
The code im using for this is :
Rows(n).Entirerow.Delete
Great!
Trouble is, i need to go through the rows at the end of the loop an
delete out all of the blank space rows left behind.
Im doing this as follows:
Code
-------------------
Lastrow = Activesheet.UsedRange.Rows - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = Lastrow to 1 step - 1
If Application.CountA(Rows(r)) = 0 then Rows(r).delete
end if
next r
-------------------
Is there a better way of getting rid of the rows rather than looping
Its just my code is taking forever.
Cheer
rows.
Basically, my code is cycling through the rows in a spreadsheet an
deleting certain rows.
The code im using for this is :
Rows(n).Entirerow.Delete
Great!
Trouble is, i need to go through the rows at the end of the loop an
delete out all of the blank space rows left behind.
Im doing this as follows:
Code
-------------------
Lastrow = Activesheet.UsedRange.Rows - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = Lastrow to 1 step - 1
If Application.CountA(Rows(r)) = 0 then Rows(r).delete
end if
next r
-------------------
Is there a better way of getting rid of the rows rather than looping
Its just my code is taking forever.
Cheer