Copy print Area

mroseto

Board Regular
Joined
Jul 18, 2002
Messages
203
Hello,

Is there a quick and easy way to copy print area from 1 sheet to another? I have 380 sheets that I need to set with the same area and would love to not set each one up separately.

Thanks

Mike
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Change the .PrintArea = "$A$1:$E$14" to be whatever your print area range is.


Code:
Sub PrintArea()
 Dim ws As Worksheet
    Application.ScreenUpdating = False
    For Each ws In ActiveWorkbook.Sheets
         'False to extend the current selection to include
         ' any previously selected objects and the specified object
         ws.PageSetup.PrintArea = "$A$1:$E$14"
        ws.Select False
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Mate,

Try the approach below. First all in Excel 2007-2010 Page setup is very slow.

I am using Call PrintToAnotherPrinter - To change printers to speed up process and then Sub PrintSetup(strCurrentPrinter As String).<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>


Code:
'.................................................................................
'header/footer syntax
'Font Change:
'A font Change is an ampersand, then a quote, the font name,
'then the font style, then another quote.
'Font Style Values can be: "Bold, Italic, BoldItalic, Regular"
'Example: &"Arial,Bold"
'myStr = "&""Arial,Bold"""
'Standalone Sytle Tags:
'&U = Underline
'&E = Double Underline
'&S = Strike Through
'&Y = SubScript
'&X = Superscipt
'Function Tags():
'&P = Page
'&N = Pages
'&D = Date
'&T = Time
'&Z = Path
'&F = File
'&A = Tab
'
'*Notes:
'Style Tags my be "closed" by adding another tag of the same type.
'(ex "Normal &U Undeline&U Normal")
'The total character count for all three segments of the header
'may not exceed 255 characters. The same hold true of footers.
'There is a &G tag that is used as an image place holder.
'However you set an image via the HeaderPicture Properties
'and the tag is automatically inserted.
'Passing default Printer Name
Sub PrintSetup(strCurrentPrinter As String)
Dim M As Long, N As Long
'Speeding Up VBA Code
Application.ScreenUpdating = False 'Prevent screen flickering
Application.Calculation = False 'Preventing calculation
Application.DisplayAlerts = False 'Turn OFF alerts
Application.EnableEvents = False 'Prevent All Events
Application.DisplayStatusBar = False
 
Dim ws As Worksheet
For Each ws In Worksheets
'Excludes "Mod", "Original" and "Job Book"
'InStr(1, ws.Name, "Mod", vbTextCompare) = 0 ' 0 means False
If InStr(1, ws.Name, "Mod", vbTextCompare) = 0 _
And InStr(1, ws.Name, "Things To Do", vbTextCompare) = 0 _
And InStr(1, ws.Name, "Input", vbTextCompare) = 0 _
And InStr(1, ws.Name, "Sample", vbTextCompare) = 0 _
And InStr(1, ws.Name, "Page Setup", vbTextCompare) = 0 Then
With ws.PageSetup
'.DisplayPageBreaks = False 'Speed up vba code
'If you are inserting/deleting hiding/unhiding rows (rows/columns) or changing page layout in any way. Turn off PageBreaks.
.LeftFooter = "&A"
.CenterFooter = "Printed &D &T"
.RightFooter = "Page &P of &N"
.PrintTitleRows = "$1:$1"
.PrintArea = ws.UsedRange.Address
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
'.DisplayPageBreaks = True
End With
End If
Next ws
'Speeding Up VBA Code
Application.ScreenUpdating = True 'Prevent screen flickering
Application.Calculation = True 'Preventing calculation
Application.DisplayAlerts = True 'Turn OFF alerts
Application.EnableEvents = True 'Prevent All Events
Application.DisplayStatusBar = True
 
End Sub
 
'To change printers to speed up process
Private Sub PrintToAnotherPrinter()
Dim strCurrentPrinter As String
strCurrentPrinter = Application.ActivePrinter ' store the current active printer
On Error Resume Next ' ignore printing errors
Application.ActivePrinter = "Microsoft XPS Document Writer on Ne00:" ' change to another printer
Call PrintSetup(strCurrentPrinter)
Application.ActivePrinter = strCurrentPrinter ' change back to the original printer
On Error GoTo 0 ' resume normal error handling
End Sub

Let me know if this helps.

Biz
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top