• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to set print area on multiple sheets in Excel 2007

jbegley

New Member
I need the help of the talented folks on this board. I've got a spreadsheet with 86 identical sheets, but the print area is off on each. When you select multiple sheets the Print Area button grays out. So looks like a job for VBA, however, my VBA skills are limited to copying snippets off the web and running them. So, to that end, does anyone have a quick VBA macro to set the print area of all sheets in the workbook to a certain range? Any help is appreciated.


Thanks in advance,

Jeff
 
Hi ,


I think the following should do the job :

[pre]
Code:
Public Sub set_print_range()
For Each ws In Worksheets
ws.PageSetup.Orientation = xlLandscape  ' Change this to suit your requirement
ws.PageSetup.PrintArea = "$A$1:$C$5"    ' Change this to suit your requirement
ws.PageSetup.PaperSize = xlPaperA4      ' Change this to suit your requirement
ws.PrintOut
Next
End Sub
[/pre]

Copy this into the ThisWorkBook section in your VBA Project.


Narayan
 
Back
Top