Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
set area in excel not giving me option to set print area? J Littlebear Excel Discussion (Misc queries) 4 April 23rd 23 09:04 PM
Macro - Set Print Area for Changing Data Area ksp Excel Programming 5 May 15th 06 10:20 PM
Set print area problem Philip Reece-Heal Excel Programming 6 January 14th 06 08:13 PM
How do you turn off a print area for a page? (no print area) Grunen Excel Discussion (Misc queries) 4 October 8th 05 07:46 PM
In Excel print area setup problem with 2 different computers with. Rafi Setting up and Configuration of Excel 1 December 22nd 04 10:44 AM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"