View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default Setting print areas

AMK4:

I don't know if I completely understand your question. If you want the
print area to adjust to the size of your data, you can define a worksheet
level name. Insert Name Define - put Sheet3!Print_Area in the name box.
In the refersto box, put

=Offset(A1,0,0,counta($a:$a),17)

Now the print area will be however many entries you have in column A and 17
column wide (Q).

--
Dick Kusleika
MVP-Excel
www.dailydoseofexcel.com

AMK4 wrote:
Short story: I have a sheet that's dynamically created/populated with
data coming from a "template sheet". What's the best way to figure
out the proper page setup for printing?

Long story: Sheet 1 has a column of information that will be used to
populate a template. Sheet 2 has the template (A1:Q18) that gets
copied and dumped on Sheet 3 and then populated with row information
from Sheet 1. Rinse, lather, repeat for however many rows of data
exists on Sheet 1.

When I print manually, I can take three of those blocks (A1:Q18,
A19:Q18, A37:Q18) and print them on one paper sheet. How can I figure
out what will fit on a sheet and set the print size accordingly
through VBA? so that someone else using this can just hit print and
have the page setup already be set for them.