View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Harley Harley is offline
external usenet poster
 
Posts: 16
Default Dynamic print area

I am having trouble creating a dynamic print area. I need to print a sheet
that is updated from other sheets in the same workbook. There will always be
data in columns A-G and a variable number of rows.

LngLastRow = ActiveSheet.Range("G65536").End(xlUp).Row
ActiveSheet.Range("A1:G" & LngLastRow).Select
ActiveSheet.PageSetup.PrintArea = ("A1:G" & LngLastRow)

I use the above code to establish the range of cells used and to then
establish the print area. It appears to work because dashed lines are around
the selected range, but it does not print as I had hoped. I was expecting, in
this case, to have 2 printed sheets , but I have 4 printed sheets with
columns F & G on pages 3 and 4.

TIA