#1   Report Post  
Posted to microsoft.public.excel.misc
Graham Haughs
 
Posts: n/a
Default Print Macro Problem

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


  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Print Macro Problem

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:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Graham Haughs
 
Posts: n/a
Default Print Macro Problem

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

Graham

Dave Peterson wrote:
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:

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



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
Macro Print Numbers dah Excel Discussion (Misc queries) 1 January 23rd 06 06:08 PM
Macro to include Close Print Preview Vic Charts and Charting in Excel 1 January 9th 06 01:06 AM
Macro problem Frazer Excel Discussion (Misc queries) 3 August 18th 05 01:43 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
deleting a macro resulted in a problem militant Excel Discussion (Misc queries) 9 April 29th 05 08:01 PM


All times are GMT +1. The time now is 10:23 PM.

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"