View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dolppm dolppm is offline
external usenet poster
 
Posts: 2
Default Setting Print Area

Figured it out.

ActiveSheet.PageSetup.PrintArea = Range("g1").Value

"dolppm" wrote:

I have a number of similar worksheets that I want to open through a script
and print only the last page of data. Each worksheet has varrying amounts of
data that change each month so I have a formula in each (in cell G1) that
displays the range equal to the last page of data (formula evaluates to
A125:E156 for instance).

As I open each worksheet with the script, how do I set the Print Range equal
to the range the formula returns?

Thanks,

Pete