ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Print Area (https://www.excelbanter.com/excel-discussion-misc-queries/235649-print-area.html)

nc

Print Area
 
How can I set a print area using macros, up to the last filled row and hard
code the number of columns ?

Don Guillett

Print Area
 
The preferred method is to use a defined name
Assuming you have a Print_Area modify it to use an OFFSET formula such as
=offset($a$1,0,0,counta($a:$a)-1,15)
Now, it will be self adjusting without action on your part
Look in the help index for OFFSET


Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
How can I set a print area using macros, up to the last filled row and
hard
code the number of columns ?



nc

Print Area
 
Thanks. One problem with the name method is that I have to define a name
plus code for each print button on the worksheet. If I use your formula
below, Excel adds the sheet name. I cannot use active sheet in the name.

The second is that I am using a macro that deletes the row a1, before
printing.


"Don Guillett" wrote:

The preferred method is to use a defined name
Assuming you have a Print_Area modify it to use an OFFSET formula such as
=offset($a$1,0,0,counta($a:$a)-1,15)
Now, it will be self adjusting without action on your part
Look in the help index for OFFSET


Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
How can I set a print area using macros, up to the last filled row and
hard
code the number of columns ?




Don Guillett

Print Area
 
If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
Thanks. One problem with the name method is that I have to define a name
plus code for each print button on the worksheet. If I use your formula
below, Excel adds the sheet name. I cannot use active sheet in the name.

The second is that I am using a macro that deletes the row a1, before
printing.


"Don Guillett" wrote:

The preferred method is to use a defined name
Assuming you have a Print_Area modify it to use an OFFSET formula such as
=offset($a$1,0,0,counta($a:$a)-1,15)
Now, it will be self adjusting without action on your part
Look in the help index for OFFSET


Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
How can I set a print area using macros, up to the last filled row and
hard
code the number of columns ?





nc

Print Area
 
Thanks. I have to figured out how to code using active sheet method.

"Don Guillett" wrote:

If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
Thanks. One problem with the name method is that I have to define a name
plus code for each print button on the worksheet. If I use your formula
below, Excel adds the sheet name. I cannot use active sheet in the name.

The second is that I am using a macro that deletes the row a1, before
printing.


"Don Guillett" wrote:

The preferred method is to use a defined name
Assuming you have a Print_Area modify it to use an OFFSET formula such as
=offset($a$1,0,0,counta($a:$a)-1,15)
Now, it will be self adjusting without action on your part
Look in the help index for OFFSET


Don Guillett
Microsoft MVP Excel
SalesAid Software

"nc" wrote in message
...
How can I set a print area using macros, up to the last filled row and
hard
code the number of columns ?






All times are GMT +1. The time now is 11:02 AM.

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