ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Find print area (https://www.excelbanter.com/excel-discussion-misc-queries/64613-find-print-area.html)

enginguven

Find print area
 
I have a data set with varying range. The maximum column limits are A and AB.
There is no upper limit for number of rows but data set starts from the 23rd
row. I want a macro to find the last nonempty row and column and return their
position. So in the end it would choose this area as a "Print_Area".
For example: If the last filled column is Z and the last filled row is 2876,
I want the macro to return Z2876. So I would set A23:Z2876 as the print area.

Please help meee!!!

Gary L Brown

Find print area
 
ActiveSheet.Cells.SpecialCells(xlLastCell).Address

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"enginguven" wrote:

I have a data set with varying range. The maximum column limits are A and AB.
There is no upper limit for number of rows but data set starts from the 23rd
row. I want a macro to find the last nonempty row and column and return their
position. So in the end it would choose this area as a "Print_Area".
For example: If the last filled column is Z and the last filled row is 2876,
I want the macro to return Z2876. So I would set A23:Z2876 as the print area.

Please help meee!!!



All times are GMT +1. The time now is 01:55 AM.

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