LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 
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 08:39 PM.

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"