View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Page set up for all worksheets

sub Main()
dim ws as worksheet
for each ws in worksheets
ws.activate
VBAMacro
next
End Sub

"Jodie" wrote:

Hello,

I am trying to run the following macro for all sheets in a workbook:

Sub VBAMacro()
Cells.Select
Range("D1").Activate
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.PrintGridlines = True
.Orientation = xlLandscape
.PrintTitleRows = ""
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 5
End With
ActiveWorkbook.Save
End Sub

How can I make it work?
--
Thank you, Jodie