View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
TOMB TOMB is offline
external usenet poster
 
Posts: 25
Default Changing PageSetup Across All Worksheets

Thanks. That did it.

"Don Guillett" wrote:

Try changing
With ActiveSheet.PageSetup
to
With sh.PageSetup

Don Guillett
SalesAid Software

"TOMB" wrote in message
...
I need to print several (30-40) workbooks which contain differently named
sheets and some do not have defined print properties. I have code that

opens
any xls file in the designated folder, but I have not been able to set the
print properties for every sheet in each file as it opens.

I need to set the sheets to print landscape and fit to 1 page wide and 1
page tall.

I have started with the following code:

Dim sh As Worksheet

For Each sh In ActiveWorkbook.Sheets
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Next sh

End Sub

I have not been able to get the code to test correctly on a test file. Not
all settings seem to apply to all sheets.

Thanks for any help.

- - TB - -