Print Area

N

nc

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

Don Guillett

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
[email protected]
 
N

nc

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.
 
D

Don Guillett

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.
 
Top