Post by StephenPost by n***@sneakemail.comI have an excel file with many sheets. I would like to do the same
'Page Setup' and 'Print Area ->Set Print Area' for every page in the
file. Is there a way to do this without having to do each sheet
manually?
Thanks.
Select all the sheets. (To do this, click on the tab of the first, then hold
down SHIFT whilst clicking the tab of the last). Then, whatever you do to
the visible sheet (such as setting the print area) will be applied to all.
So, don't forget to remove the multiple sheet selection (click any
intermediate sheet tab) before you carry on with other work!
Stephen,
When I tried that (xl2003) the Set Print Area option was greyed out.
I think a macro needs to be used...
Option Explicit
Sub PrintAreaAllWkshts()
Dim strPA As String, Sht As Worksheet
On Error GoTo NOT_RANGE
strPA = Selection.Address
For Each Sht In ActiveWorkbook.Worksheets
Sht.PageSetup.PrintArea = strPA
Next
Exit Sub
NOT_RANGE: MsgBox "Select the Print Area Cells, then try again!"
End Sub
seems to work.
Ken Johnson