Setting page layout and print set up in code for a new worksheet
Try below. The best way would be to record a macro and review the code which
is generated....Then edit to suit your requirements...
With wbNew.Sheets("results").PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Order = xlDownThenOver
.FitToPagesWide = 1
.FitToPagesTall = 10
End With
--
If this post helps click Yes
---------------
Jacob Skaria
"NDBC" wrote:
I have just created a new worksheet with the data the way I want it. Now I
would like to set the page layout for printing to landscape and set it so it
scales to print 1 page wide by 10 pages long. Can this be done in code.
In my code the sheet is called wbNew.Sheets("results")
Thanks
|