Worksheet(1).PageSetup

R

rajltd

Hi,

The following command will help me change the pagesetup for the first
sheet of the workbook.

With Worksheets(1).PageSetup

.LeftHeader = ""
.CenterHeader = "&A"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "Page &P"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
' .FitToPagesTall = 1
End With


Can anyone help me, if i want the same thing to happen to the whole
workbook instead of only first sheet of the workbook.

I have also tried

With ActiveSheet.PageSetup

Other commands remaining the same.

But its no use for me, as I want this to happen for all sheets of the
workbook.

This is part of the marco.

Thanks for help.

Raj
 
D

Don Guillett

Try this
Sub setemall()
For Each ws In Sheets
With ws.PageSetup
.Zoom = 200
.PrintErrors = xlPrintErrorsDisplayed
End With
Next
End Sub
 

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

Similar Threads

Printing Macro 6
Formula in Header 2
Optimize Beginner's Code 1
Print area - selection 4
Auto populate dates 2
Macro help: File path in Excel 2000 2
Header and Footer Macro 1
Footer Settings in an Excel Sheet 1

Top