Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting page layout and print set up in code for a new worksheet
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting page layout and print set up in code for a new workshe
Thanks again. It didn't work properly so I did what you said and found i
needed this. With wbNew.Sheets("results").PageSetup .Orientation = xlLandscape .PaperSize = xlPaperA4 .Order = xlDownThenOver .Zoom= False .FitToPagesWide = 1 .FitToPagesTall = 10 End With I have tried using record macro before but sometimes it seems to record stuff that needs to be changed to make vb code work in programs (eg applications). "Jacob Skaria" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
First page of Excel sheerepeats in print layout or print preview | Excel Discussion (Misc queries) | |||
Setting the print area in page set up to print 1 page wide by 2 pages tall | Excel Discussion (Misc queries) | |||
How do I print a page with a horizontal layout? | Excel Discussion (Misc queries) | |||
Can't change page layout to print one sided for the wholeworkbook | Excel Discussion (Misc queries) | |||
Code for Print Layout | Excel Discussion (Misc queries) |