Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Can't print only 1 page wide-what am I doing wrong?

I am using the following code to print out a worksheet on a landscaped
page. I want all the columns to fit across the width of one page;
rows can slip onto the next page. In my code, I set FitToPagesWide =
1, but it doesn't do what I think it should.

What am I dong wrong?

Ed


' Prints Sheet2 list
Set rngWork = wks2.UsedRange
With wks2.PageSetup
.Orientation = xlLandscape
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.PrintArea = rngWork.Address
.FitToPagesWide = 1
.CenterHeader = "&D"
.CenterFooter = "Page &P of &N"
.PrintTitleRows = wks2.Rows(1).Address
End With

wks2.PrintOut

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Can't print only 1 page wide-what am I doing wrong?

From XL/VBA Help ("FitToPagesWide" topic):

If the Zoom property is True, the FitToPagesWide
property is ignored.


So set

.Zoom = False

In article .com,
Ed from AZ wrote:

I am using the following code to print out a worksheet on a landscaped
page. I want all the columns to fit across the width of one page;
rows can slip onto the next page. In my code, I set FitToPagesWide =
1, but it doesn't do what I think it should.

What am I dong wrong?

Ed


' Prints Sheet2 list
Set rngWork = wks2.UsedRange
With wks2.PageSetup
.Orientation = xlLandscape
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.PrintArea = rngWork.Address
.FitToPagesWide = 1
.CenterHeader = "&D"
.CenterFooter = "Page &P of &N"
.PrintTitleRows = wks2.Rows(1).Address
End With

wks2.PrintOut

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can't print only 1 page wide-what am I doing wrong?

You should have all these commands:

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


--
Regards,
Tom Ogilvy


"Ed from AZ" wrote:

I am using the following code to print out a worksheet on a landscaped
page. I want all the columns to fit across the width of one page;
rows can slip onto the next page. In my code, I set FitToPagesWide =
1, but it doesn't do what I think it should.

What am I dong wrong?

Ed


' Prints Sheet2 list
Set rngWork = wks2.UsedRange
With wks2.PageSetup
.Orientation = xlLandscape
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.PrintArea = rngWork.Address
.FitToPagesWide = 1
.CenterHeader = "&D"
.CenterFooter = "Page &P of &N"
.PrintTitleRows = wks2.Rows(1).Address
End With

wks2.PrintOut


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Can't print only 1 page wide-what am I doing wrong?

Thanks to both of you. I originally had Zoom = False, just before the
FitToPagesWide setting, but I thought the Help instructions meant that
if either of the FitToPages settings was active, then Zoom was
automatically false, and setting Zoom to a percentage would override
the FitToPages settings. Thanks for setting me straight.

Ed

On Oct 1, 11:36 am, Tom Ogilvy
wrote:
You should have all these commands:

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

--
Regards,
Tom Ogilvy



"Ed from AZ" wrote:
I am using the following code to print out a worksheet on a landscaped
page. I want all the columns to fit across the width of one page;
rows can slip onto the next page. In my code, I set FitToPagesWide =
1, but it doesn't do what I think it should.


What am I dong wrong?


Ed


' Prints Sheet2 list
Set rngWork = wks2.UsedRange
With wks2.PageSetup
.Orientation = xlLandscape
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.PrintArea = rngWork.Address
.FitToPagesWide = 1
.CenterHeader = "&D"
.CenterFooter = "Page &P of &N"
.PrintTitleRows = wks2.Rows(1).Address
End With


wks2.PrintOut- Hide quoted text -


- Show quoted text -



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
Setting the print area in page set up to print 1 page wide by 2 pages tall EA[_2_] Excel Discussion (Misc queries) 2 July 12th 07 08:39 PM
Page Setup Not Fitting To One Page Wide MDW Excel Programming 3 September 15th 06 09:58 PM
Problem Scaling to 1 Page Wide Pete Excel Discussion (Misc queries) 4 December 20th 05 04:16 PM
Printing: Best Fit (1 Page Wide) Pavlos Excel Programming 2 March 29th 05 10:15 PM
Page Header with Fit to 1 page wide Josh Smith[_2_] Excel Programming 0 July 15th 03 09:51 PM


All times are GMT +1. The time now is 11:15 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"