Solved

How to set print area for multiple sheets in Excel 2003

Posted on 2012-03-14
2
276 Views
Last Modified: 2012-06-21
I have a report that contains 189 worksheets in one book. I set up my first sheet with the print area I am looking for and none of the other sheets are set up this way.  I tried to select all 189 tabls and set print area but it will only let do one sheet at a time?  It is greyed out and will not allow me to choose this option.  Any help would be appreciated.  Thanks.
0
Comment
Question by:mishlce
2 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
ID: 37722741
While you can certainly select all tabs and print, you have to set the print area on a workbook, one sheet at a time.

Here's a macro you can use that will take the CURRENT sheet's print area, and propogate it to the rest of the workbook.  

Option Explicit

Sub setPrintAreaWkb()
Dim wkb As Workbook
Dim wks As Worksheet
Dim wksSet As Worksheet
Dim r As Range

    Set wkb = ActiveWorkbook
    Set wks = wkb.ActiveSheet
    
    On Error Resume Next
    Set r = wks.Range("'" & wks.Name & "'!Print_Area")
    If Err.Number <> 0 Then
        MsgBox "First, Set the print area for one sheet, then on that sheet, run this macro to propogate the same print area across the workbook.", vbCritical, "Aborting!  Try again"
    Else
        On Error GoTo 0
        
        For Each wksSet In wkb.Worksheets
            If wksSet.Name <> wks.Name Then 'change the print area setting
                wksSet.Range(wks.Range("Print_Area").Address).Name = "'" & wksSet.Name & "'!Print_Area"
            End If
        Next wksSet
    End If
    
    MsgBox "Print Areas are now set to active sheet's settings in the entire workbook"
End Sub

Open in new window


Hope this helps!

See attached demonstration workbook.

Just set the print area to a different range on the Sheet1 sheet (that's where the macro button is) and then hit the button.  All worksheet tabs will then have that same range as their respective print areas.

Dave
setPrintAreaEntireWorkbook-r1.xls
0
 

Author Closing Comment

by:mishlce
ID: 37725082
This worked Perfect!!  Thank you so much.  Huge time saver!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now