View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default program to print some landscape, some portrait?

By "two page report" do you mean the data is on two spreadsheets, or one
spreadsheet that prints two pages in length?.

Printing both sides of a single piece of paper requires two passes (usually).

For two spreadsheets: set orientation for each sheet in PageSetup. Print
the first, then the second.

For one spreadsheet:
Assign a local Defined Name for each 'page range' of cells. (eg:
"Pg1_Print", "Pg2_Print")
Use a macro for each print pass, that sets the orientation for each range.
Run macro1, then reload the paper and run macro2.

possible coding: identical for both orientations
Sub PrintPg1() '( PrintPg2() for 2nd macro)
With ActiveSheet.Range("Pg1_Print") '( "Pg2_Print" for 2nd macro)
With .PageSetup
'set parameters how you want
.Orientation = xlPortrait '( xlLandscape for 2nd macro)
End With
'print it, OR preview it
End With
End Sub

This would be similar to selecting the range manually and choosing '
Selection ' in the Prit dialog.
Use the macro recorder and do it manually. This will give you some idea of
what code to use for PageSetup parameters. Do not include any printer
specific parameters (eg: PrintQuality) to avoid an error message if another
user has a different printer.

Hope this helps!
GS