Excel 2003: Print Area

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a workbook with 12 worksheets in it. They are all basically the same
so when I set the print area for one it could be the same for all 12
worksheets. Is there a way to do this all at once rather than 12 times?
 
Try this subroutine

Sub Macro1()
For Each ws In Worksheets
ws.Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$E$20"
Next
End Sub

Let me know if you need help adding a macro
best wishes
 
Yes, I do. I don't have a clue how to do this.

Bernard Liengme said:
Try this subroutine

Sub Macro1()
For Each ws In Worksheets
ws.Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$E$20"
Next
End Sub

Let me know if you need help adding a macro
best wishes
 
With you workbook open use the command Tools | Macro | Visual Basic Editor
In the Edit use Insert | Module
Now copy and paste my module to the main window in the Editor
Is some lines get split into two in the email, carefully use
delete/backspace to fix. The longest line is
ActiveSheet.PageSetup.PrintArea = "$A$1:$E$20"
and should appear as one line

Return to the worksheet; Use Tools | Macro | Macros and click on TryThis

best wishes (don't be afraid to ask for clarification)
 

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

Back
Top