Solved

How to set print area for multiple sheets in Excel 2003

Posted on 2012-03-14
2
286 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 42

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

749 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