Page setup for multiple pages

L

Lynn

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.
 
S

steve

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top