Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Page setup for multiple pages

I want my macro to apply the same print settings to
multiple sheets in my workbook. I have tried the
following code but get an error in the first line.

With ActiveWorkbook.Worksheets(Array
("Reference", "IncomeStatement", "CashStatement
1", "CashStatement 2")).PageSetup
.PaperSize = xlPaperLegal
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Any suggestions are much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Page setup for multiple pages

Lynn,

Not sure - but I think you need to loop through the sheets separately.
This worked for me...

Dim x as Long
For x = 1 to 4
With ActiveWorkbook.Sheets(x).PageSetup
.PaperSize = xlPaperLegal
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Next

You could use an If or Select Case to set the worksheet names
for each x.
--
sb
"Lynn" wrote in message
...
I want my macro to apply the same print settings to
multiple sheets in my workbook. I have tried the
following code but get an error in the first line.

With ActiveWorkbook.Worksheets(Array
("Reference", "IncomeStatement", "CashStatement
1", "CashStatement 2")).PageSetup
.PaperSize = xlPaperLegal
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Any suggestions are much appreciated.



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 page setup/print area for multiple sheets [email protected] Excel Discussion (Misc queries) 6 October 27th 07 01:19 PM
When using show pages in a pivot table can I keep the page setup? AneelaJ Excel Discussion (Misc queries) 1 June 23rd 07 12:48 PM
changing the page setup for multiple worksheets in a workbook Joe Skochdopole Excel Discussion (Misc queries) 3 March 7th 06 04:52 PM
Page Setup Across Multiple Worksheets Mike Excel Worksheet Functions 0 February 9th 06 06:31 PM
Page Setup for multiple worksheets macro problem KonaAl Excel Discussion (Misc queries) 3 January 7th 06 02:33 AM


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