Print Macro Problem

G

Graham Haughs

I am pulling what is left of my hair out with this one. The Procedure below
is set up to print out a dynamic range which it does fine but it refuses to
restict the size to one page wide. I have an almost identical procedure
elsewhere and it works fine and I have copied it and just changed the named
print area but it still refuses to do it. Any help would be most
appreciated.
Sub printpkmanureplanner()
If Range("a5").Value = "" Then
MsgBox "There are no fields to print. Operation cancelled",
vbInformation, "Print Cancelled"
Exit Sub
End If
ActiveSheet.PageSetup.PrintArea = "AAPKPlannedCrops"
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$4"
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 20
.LeftFooter = "&F"
End With
ActiveWindow.SelectedSheets.PrintOut
End Sub

Graham Haughs
Turriff
Scotland
 
D

Dave Peterson

I would think that by setting the .fittopageswide to 1, that you would want the
..fittopagestall to be whatever it needed--not 20.

I'd use:

.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False

(.zoom is important)
 
G

Graham Haughs

Many thanks Dave, that has done the trick perfectly. The zoom seemed to
be the missing link.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top