Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fit to page in macro

Hi

I have a simple macro in Excel 97:

Sub PrintFormat()
With ActiveSheet.PageSetup
.LeftFooter = "&D&T"
.CenterFooter = "&A"
.RightFooter = "&F"
.PrintGridlines = True
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub

I run this from any worksheet page without selecting a particular block of cells. The FitToPages instructions at the end don't work. I intend to be fitting the entire worksheet contents into an A4 page, as would happen if I set these options manually in page setup.

I have a feeling I need to specify the area of the worksheet in which there is data to print. Am I right? How would I do that?

Advice gratefully received

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Fit to page in macro

here is a print setup i did on record then modified.
i think you might need to a .zoom = something.

With ActiveSheet.PageSetup
.LeftHeader = "&D" & Chr(10) & LHeadTC & " " & "Total
Items"
.CenterHeader = "&16Top 50 Line Items WIP"
.RightHeader = _
"Top 50 Value Total WIP Value Percent" & Chr
(10) & _
RHead & " " & RHead1 & " " & RHead2 &
Chr(10) & _
"Top 120 Value Total WIP Value Percent" & Chr
(10) & _
RHeadD & " " & RHeadD1 & " " & RHeadD2
& Chr(10) & ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$E"
.LeftMargin = Application.InchesToPoints(0.3)
.RightMargin = Application.InchesToPoints(0.3)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 65
End With
-----Original Message-----
Hi

I have a simple macro in Excel 97:

Sub PrintFormat()
With ActiveSheet.PageSetup
.LeftFooter = "&D&T"
.CenterFooter = "&A"
.RightFooter = "&F"
.PrintGridlines = True
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub

I run this from any worksheet page without selecting a

particular block of cells. The FitToPages instructions at
the end don't work. I intend to be fitting the entire
worksheet contents into an A4 page, as would happen if I
set these options manually in page setup.

I have a feeling I need to specify the area of the

worksheet in which there is data to print. Am I right? How
would I do that?

Advice gratefully received

Steve
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
jd jd is offline
external usenet poster
 
Posts: 91
Default Fit to page in macro

..zoom = true or false. I can remembe off hand, but one of them will work.



"Frank Stone" wrote:

here is a print setup i did on record then modified.
i think you might need to a .zoom = something.

With ActiveSheet.PageSetup
.LeftHeader = "&D" & Chr(10) & LHeadTC & " " & "Total
Items"
.CenterHeader = "&16Top 50 Line Items WIP"
.RightHeader = _
"Top 50 Value Total WIP Value Percent" & Chr
(10) & _
RHead & " " & RHead1 & " " & RHead2 &
Chr(10) & _
"Top 120 Value Total WIP Value Percent" & Chr
(10) & _
RHeadD & " " & RHeadD1 & " " & RHeadD2
& Chr(10) & ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$E"
.LeftMargin = Application.InchesToPoints(0.3)
.RightMargin = Application.InchesToPoints(0.3)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 65
End With
-----Original Message-----
Hi

I have a simple macro in Excel 97:

Sub PrintFormat()
With ActiveSheet.PageSetup
.LeftFooter = "&D&T"
.CenterFooter = "&A"
.RightFooter = "&F"
.PrintGridlines = True
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub

I run this from any worksheet page without selecting a

particular block of cells. The FitToPages instructions at
the end don't work. I intend to be fitting the entire
worksheet contents into an A4 page, as would happen if I
set these options manually in page setup.

I have a feeling I need to specify the area of the

worksheet in which there is data to print. Am I right? How
would I do that?

Advice gratefully received

Steve
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fit to page in macro

add

.zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1

--
Regards,
Tom Ogilvy

"Stevenumber50" wrote in message
...
Hi

I have a simple macro in Excel 97:

Sub PrintFormat()
With ActiveSheet.PageSetup
.LeftFooter = "&D&T"
.CenterFooter = "&A"
.RightFooter = "&F"
.PrintGridlines = True
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub

I run this from any worksheet page without selecting a particular block of

cells. The FitToPages instructions at the end don't work. I intend to be
fitting the entire worksheet contents into an A4 page, as would happen if I
set these options manually in page setup.

I have a feeling I need to specify the area of the worksheet in which

there is data to print. Am I right? How would I do that?

Advice gratefully received

Steve



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fit to page in macro

"Stevenumber50" wrote in message ...
Hi

I have a simple macro in Excel 97:

Sub PrintFormat()
With ActiveSheet.PageSetup
.LeftFooter = "&D&T"
.CenterFooter = "&A"
.RightFooter = "&F"
.PrintGridlines = True
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub

I run this from any worksheet page without selecting a particular block of cells. The FitToPages instructions at the end don't work. I intend to be fitting the entire worksheet contents into an A4 page, as would happen if I set these options manually in page setup.

I have a feeling I need to specify the area of the worksheet in which there is data to print. Am I right? How would I do that?

Advice gratefully received

Steve


Steve,
I have had this problem. When I add

.zoom = false

the worksheet would print properly for me. Hope this helps.

John


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
Page break or Fit to Page Macro wigs Excel Worksheet Functions 0 March 31st 09 09:34 PM
Page macro user Excel Discussion (Misc queries) 2 March 18th 09 09:36 PM
How to open a web page through macro? Eric Excel Discussion (Misc queries) 1 August 25th 08 01:46 AM
Macro that copy page to page just some filled cells LC Excel Discussion (Misc queries) 0 May 13th 05 11:22 PM
How to run a macro in word web page jackie Excel Programming 0 January 7th 04 03:55 PM


All times are GMT +1. The time now is 11:07 AM.

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

About Us

"It's about Microsoft Excel"