ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i delete all the rows lying below a cell. (https://www.excelbanter.com/excel-programming/359789-how-do-i-delete-all-rows-lying-below-cell.html)

VB Script for Excel

How do i delete all the rows lying below a cell.
 
I have a file that i get from client. On a daily basis, I have to
delete all the rows after the last value on the file. Means: if the
last number ends at B25, i will select all the rows from from 26 till
the end (like..65,500th row or whatever is the last) and then delete
everything. Although these rows are empty, i still have to delete those
in order to print only till B25.

How can i create a macro that will look for the last value and delete
all the rows lying below that (till the end).?

Please note that, it is not B25 all the time. It might end at D10 or
B15. anywhere. So this macro should check for values which is at the
most bottom of any columns.

Thanks


Paul B

How do i delete all the rows lying below a cell.
 
Have a look here for ways to do it,

http://www.mvps.org/dmcritchie/excel/lastcell.htm

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"VB Script for Excel" wrote in message
oups.com...
I have a file that i get from client. On a daily basis, I have to
delete all the rows after the last value on the file. Means: if the
last number ends at B25, i will select all the rows from from 26 till
the end (like..65,500th row or whatever is the last) and then delete
everything. Although these rows are empty, i still have to delete those
in order to print only till B25.

How can i create a macro that will look for the last value and delete
all the rows lying below that (till the end).?

Please note that, it is not B25 all the time. It might end at D10 or
B15. anywhere. So this macro should check for values which is at the
most bottom of any columns.

Thanks





All times are GMT +1. The time now is 10:34 AM.

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