ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range Selection (https://www.excelbanter.com/excel-programming/321084-range-selection.html)

MrHappy

Range Selection
 
Hello,

If I have a Total's line on line A5000, and sometimes it jumps to 5001 upto
5020 or more...

Is there anyway to count the rows in between Lines 5000 and 5020 and then
have the rows deleted?

Any help would be greatly appreciated :)

Thank you!

Tim

MrHappy

Range Selection
 
K Dales...Thx...Thats great :) YEAH!

Tim

"K Dales" wrote:

For i = 5020 to 5000 step -1
If WorksheetFunction.CountA(Range(i & ":" & i)) = 0 Then Range("A" &
i).EntireRow.Delete
Next i

"MrHappy" wrote:

Hello,

If I have a Total's line on line A5000, and sometimes it jumps to 5001 upto
5020 or more...

Is there anyway to count the rows in between Lines 5000 and 5020 and then
have the rows deleted?

Any help would be greatly appreciated :)

Thank you!

Tim



All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com