View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CM CM is offline
external usenet poster
 
Posts: 136
Default How to automatically set print area in Excel template?

You can create a dynamic range name called 'Printarea'. Choose Insert Name
Define and in the 'Refers to' at the bottom you will put:

=OFFSET($a$4,0,0,counta($b$4:$b$1000),5)

This example will set the range name from the first cell in column a to the
last non-blank row based on column b, and 5 columns out to the right.

When you select page setup, you will put the range 'Printarea' in the Print
Area box on the 'Sheet' tab.

"JCMII" wrote:

I have created a BOM template. It is used by another program to create an
Excel spreadsheet BOM. The first column is an "Item" number column. There is
a formula in that column to automatically number every row that has an item
in it: =IF(B4="","",ROW()-2). I formatted 1000 rows so any BOM can fit. My
problem is that if you don't " set the Print Area before you print, you get
the 1000 lines printed. I would like to use my Item number technique to also
set the print area automatically when the BOM is created using the template.
Does anyone know how this might be accomplished? Thansk for the help.
--
Jim