Gopalakrishnan
Board Regular
- Joined
- Feb 19, 2013
- Messages
- 110
I'm trying to delete certain rows from the table using 'Clear' button, and the delete part of the code would be something like below:
This code deletes the rows as expected, but when I'm taking the used row count for next iteration it still return the previous range. i.e., if the last run had 23 rows in my table, after deleting the rows also it returns 23 unexpectedly.
I thought that deleting entire row would remove the formats too, so that next time when I take used range count for row, it would return the current value. But it's not as I thought, so please check and help me in understanding this mysterious STOP. Thanks!
~~ Gopi
Code:
For i = lngUsdRng To 2 Step -1 'lngUsdRng - is the last row used in my table
Rows(i).EntireRow.Delete
Next
This code deletes the rows as expected, but when I'm taking the used row count for next iteration it still return the previous range. i.e., if the last run had 23 rows in my table, after deleting the rows also it returns 23 unexpectedly.
I thought that deleting entire row would remove the formats too, so that next time when I take used range count for row, it would return the current value. But it's not as I thought, so please check and help me in understanding this mysterious STOP. Thanks!
~~ Gopi