Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mestrella31
 
Posts: n/a
Default set or reset the print range for several sheets at a time?

how do you set or reset the print range for several sheets at a time?
  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

Manually I don't think it's possible to set more than one sheet's print area
at a time. Of course a macro can make this a lot quicker.

--
Jim Rech
Excel MVP
"Mestrella31" wrote in message
...
| how do you set or reset the print range for several sheets at a time?


  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default


Unfortunately setting the print area on grouped sheets is not an option
without using VBA.

Code from Bob Flanagan for setting same print area on grouped sheets.

NOTE: Set the print area on ActiveSheet then Group the sheets and run the
macro.

Note: after print area is set you will most likely have to re-group to set
margins.


Sub Set_Print_Area_On_All_Selected_Sheets()
Dim tempS As String, oSheets As Object
Dim curSheet As Worksheet, oSheet As Worksheet
Dim iResponse


Application.ScreenUpdating = False
iResponse = MsgBox(prompt:= _
"Select OK to set the print area on all " & _
"selected sheets the same as the print " & _
"area on this sheet. If you have not selected " & _
"any sheets, then all worksheets will be set.", _
Buttons:=vbOKCancel)
If iResponse = vbCancel Then End


'store info
tempS = ActiveSheet.PageSetup.PrintArea
'set an object variable to refer to the sheets to be set
If ActiveWindow.SelectedSheets.Count = 1 Then
'if no sheets selected, select all worksheets
Set oSheets = ActiveWorkbook.Worksheets
Else
'set variable to select sheets
Set oSheets = ActiveWindow.SelectedSheets
End If


'store the current sheet and then rotate through each
'sheet and set the print area
Set curSheet = ActiveSheet
For Each oSheet In oSheets
If oSheet.Type = xlWorksheet Then
'set print area only if a worksheet
oSheet.PageSetup.PrintArea = tempS
End If
Next


'return to the original worksheet


curSheet.Select
MsgBox "All print areas on the selected sheets have " & _
"been set to the same as this sheet."
End Sub


Gord Dibben Excel MVP





On Mon, 10 Jan 2005 09:15:02 -0800, "Mestrella31" wrote:

how do you set or reset the print range for several sheets at a time?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to open and see 2 excel work sheets at a time cwm Excel Discussion (Misc queries) 3 December 26th 04 01:27 PM
how do I tell excell 2003 to print sheets back to front? goochiepepper Excel Discussion (Misc queries) 1 December 22nd 04 03:35 PM


All times are GMT +1. The time now is 03:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"