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(quot;a5quot;).Value = quot;quot; Then
MsgBox quot;There are no fields to print. Operation cancelledquot;,
vbInformation, quot;Print Cancelledquot;
Exit Sub
End If
ActiveSheet.PageSetup.PrintArea = quot;AAPKPlannedCropsquot;
With ActiveSheet.PageSetup
.PrintTitleRows = quot;$1:$4quot;
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 20
.LeftFooter = quot;amp;Fquot;
End With
ActiveWindow.SelectedSheets.PrintOut
End Sub
Graham Haughs
Turriff
Scotland
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)
Graham Haughs wrote:
gt;
gt; I am pulling what is left of my hair out with this one. The Procedure below
gt; is set up to print out a dynamic range which it does fine but it refuses to
gt; restict the size to one page wide. I have an almost identical procedure
gt; elsewhere and it works fine and I have copied it and just changed the named
gt; print area but it still refuses to do it. Any help would be most
gt; appreciated.
gt; Sub printpkmanureplanner()
gt; If Range(quot;a5quot;).Value = quot;quot; Then
gt; MsgBox quot;There are no fields to print. Operation cancelledquot;,
gt; vbInformation, quot;Print Cancelledquot;
gt; Exit Sub
gt; End If
gt; ActiveSheet.PageSetup.PrintArea = quot;AAPKPlannedCropsquot;
gt; With ActiveSheet.PageSetup
gt; .PrintTitleRows = quot;$1:$4quot;
gt; .Orientation = xlLandscape
gt; .PaperSize = xlPaperA4
gt; .FitToPagesWide = 1
gt; .FitToPagesTall = 20
gt; .LeftFooter = quot;amp;Fquot;
gt; End With
gt; ActiveWindow.SelectedSheets.PrintOut
gt; End Sub
gt;
gt; Graham Haughs
gt; Turriff
gt; Scotland
--
Dave Peterson
Many thanks Dave, that has done the trick perfectly. The zoom seemed to
be the missing link.
Graham
Dave Peterson wrote:
gt; I would think that by setting the .fittopageswide to 1, that you would want the
gt; .fittopagestall to be whatever it needed--not 20.
gt;
gt; I'd use:
gt;
gt; .Zoom = False
gt; .FitToPagesWide = 1
gt; .FitToPagesTall = False
gt;
gt; (.zoom is important)
gt;
gt; Graham Haughs wrote:
gt;
gt;gt;I am pulling what is left of my hair out with this one. The Procedure below
gt;gt;is set up to print out a dynamic range which it does fine but it refuses to
gt;gt;restict the size to one page wide. I have an almost identical procedure
gt;gt;elsewhere and it works fine and I have copied it and just changed the named
gt;gt;print area but it still refuses to do it. Any help would be most
gt;gt;appreciated.
gt;gt;Sub printpkmanureplanner()
gt;gt;If Range(quot;a5quot;).Value = quot;quot; Then
gt;gt; MsgBox quot;There are no fields to print. Operation cancelledquot;,
gt;gt;vbInformation, quot;Print Cancelledquot;
gt;gt; Exit Sub
gt;gt; End If
gt;gt;ActiveSheet.PageSetup.PrintArea = quot;AAPKPlannedCropsquot;
gt;gt; With ActiveSheet.PageSetup
gt;gt; .PrintTitleRows = quot;$1:$4quot;
gt;gt; .Orientation = xlLandscape
gt;gt; .PaperSize = xlPaperA4
gt;gt; .FitToPagesWide = 1
gt;gt; .FitToPagesTall = 20
gt;gt; .LeftFooter = quot;amp;Fquot;
gt;gt; End With
gt;gt; ActiveWindow.SelectedSheets.PrintOut
gt;gt;End Sub
gt;gt;
gt;gt;Graham Haughs
gt;gt;Turriff
gt;gt;Scotland
gt;
gt;
- Jun 22 Fri 2007 20:37
Print Macro Problem
close
全站熱搜
留言列表
發表留言