Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to set print area for multiple sheets in Excel 2003

Posted on 2012-03-14
2
Medium Priority
?
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

618 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