Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Print Same Range on Multiple Sheets?

I was wondering if its possible to print the same range on multiple sheets in
one command. (Rather than doing it in two parts by setting the print area
first and then printing the sheets)

for instance, i'd like to print the area named by the range name "March" on
Sheet1 and Sheet2. Is there a way to do this?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Print Same Range on Multiple Sheets?

Al,

This is not tested but should head you in the right direction. I have done
it as two subs so it is reusable. You will need to add error traps if there
is a possibility that the sheet is not open, doesn't have the right sheets,
a chart is selected in a sheet you want to print, etc.

Sub Printout()
Dim vSheetList As Variant
Dim strRangeName As String
vSheetList = Array("Sheet1", "Sheet2")
strRangeName = "March"
PrintNamedRangeInSheets vSheetList, strRangeName
End Sub

Sub PrintNamedRangeInSheets(vSheetList As Variant, strRangeName As String)
Dim vSheet As Variant
Dim shOrigin As Worksheet
Dim rngInSheet As Range

Set shOrigin = ActiveSheet

For Each vSheet In vSheetList
Sheets(vSheet).Select
Set rngInSheet = Selection
Range(strRangeName).Select
Selection.Printout Copies:=1, Collate:=True
rngInSheet.Select
Next vSheet
shOrigin.Select
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Al" wrote in message
...
I was wondering if its possible to print the same range on multiple sheets
in
one command. (Rather than doing it in two parts by setting the print area
first and then printing the sheets)

for instance, i'd like to print the area named by the range name "March"
on
Sheet1 and Sheet2. Is there a way to do this?

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Print Same Range on Multiple Sheets?

Thanks Robin! That did the trick!

"Robin Hammond" wrote:

Al,

This is not tested but should head you in the right direction. I have done
it as two subs so it is reusable. You will need to add error traps if there
is a possibility that the sheet is not open, doesn't have the right sheets,
a chart is selected in a sheet you want to print, etc.

Sub Printout()
Dim vSheetList As Variant
Dim strRangeName As String
vSheetList = Array("Sheet1", "Sheet2")
strRangeName = "March"
PrintNamedRangeInSheets vSheetList, strRangeName
End Sub

Sub PrintNamedRangeInSheets(vSheetList As Variant, strRangeName As String)
Dim vSheet As Variant
Dim shOrigin As Worksheet
Dim rngInSheet As Range

Set shOrigin = ActiveSheet

For Each vSheet In vSheetList
Sheets(vSheet).Select
Set rngInSheet = Selection
Range(strRangeName).Select
Selection.Printout Copies:=1, Collate:=True
rngInSheet.Select
Next vSheet
shOrigin.Select
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Al" wrote in message
...
I was wondering if its possible to print the same range on multiple sheets
in
one command. (Rather than doing it in two parts by setting the print area
first and then printing the sheets)

for instance, i'd like to print the area named by the range name "March"
on
Sheet1 and Sheet2. Is there a way to do this?

Thanks in advance.




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
Excel ~ print same range across sheets Jesper Audi Excel Discussion (Misc queries) 1 September 7th 07 02:12 PM
How do I add Watermark, across all the sheets in the print range, Rav Excel Worksheet Functions 3 September 6th 06 10:27 PM
set or reset the print range for several sheets at a time? Mestrella31 Excel Discussion (Misc queries) 2 January 10th 05 09:07 PM
how do you set or reset the print range for several sheets at a ti Mestrella31 Excel Programming 2 January 10th 05 05:28 PM
Print Multiple Sheets RogerM Excel Programming 2 August 4th 03 03:21 PM


All times are GMT +1. The time now is 04:32 PM.

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"