Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print area problem
I have part of a print procedure below. The problem is with the FitToPages... requirments.
The print works fine but after the first page is printed which is perfect, the rest all do not fit to the page and take 3 sheets to cover the print area. I know it must be staring me in the face but frustration is overcoming reasoned thought. I would value any help. Graham r = Sheets("Entries").Cells(Rows.Count, "A").End(xlUp).row For Each c In Sheets("Entries").Range("A12:A" & r) ' check if sheet exists If WksExists(c.Value) Then Set rng = Sheets(c.Value).Range("a1:o48") With Sheets(c.Value).PageSetup .Orientation = xlLandscape .PaperSize = xlPaperA4 .FitToPagesWide = 1 .FitToPagesTall = 1 End With rng.PrintOut Copies:=1, Preview:=False, Collate:=True End If Next End Sub Function WksExists(wksName As String) As Boolean On Error Resume Next WksExists = CBool(Len(Worksheets(wksName).Name) 0) End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print area problem
Just for completeness if anyone has a similar problem I eventually found out the problem.
To get the printout to fit to one page wide by one page long, in the With Sheets(c.Value).pagesetup you must also put in .zoom = false This them allows the fit to page criteria to work. It took a long time but I got there. Graham H wrote: I have part of a print procedure below. The problem is with the FitToPages... requirments. The print works fine but after the first page is printed which is perfect, the rest all do not fit to the page and take 3 sheets to cover the print area. I know it must be staring me in the face but frustration is overcoming reasoned thought. I would value any help. Graham r = Sheets("Entries").Cells(Rows.Count, "A").End(xlUp).row For Each c In Sheets("Entries").Range("A12:A" & r) ' check if sheet exists If WksExists(c.Value) Then Set rng = Sheets(c.Value).Range("a1:o48") With Sheets(c.Value).PageSetup .Orientation = xlLandscape .PaperSize = xlPaperA4 .FitToPagesWide = 1 .FitToPagesTall = 1 End With rng.PrintOut Copies:=1, Preview:=False, Collate:=True End If Next End Sub Function WksExists(wksName As String) As Boolean On Error Resume Next WksExists = CBool(Len(Worksheets(wksName).Name) 0) End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
set area in excel not giving me option to set print area? | Excel Discussion (Misc queries) | |||
Macro - Set Print Area for Changing Data Area | Excel Programming | |||
Set print area problem | Excel Programming | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) | |||
In Excel print area setup problem with 2 different computers with. | Setting up and Configuration of Excel |