Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel - I want to predefine more than one print area option - how

I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges so
the users can just select PrintArea1 or PrintArea2?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Excel - I want to predefine more than one print area option - how

Lots of ways. A cell with 1 or 2 and a macro or an input box in the macro

--
Don Guillett
SalesAid Software

"zip82dah" wrote in message
...
I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges
so
the users can just select PrintArea1 or PrintArea2?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Excel - I want to predefine more than one print area option - how

probably best done with a macros such as

ActiveSheet.PageSetup.PrintArea = "$E$14:$J$23"

You could put a button on the worksheet to call the macro for the different
print areas

"zip82dah" wrote:

I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges so
the users can just select PrintArea1 or PrintArea2?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Excel - I want to predefine more than one print area option - how

You can use ViewCustom Views to set up two different print ranges for your
users to pick from.

Or you could use a macro to print a selected range

You can use the name of the custom view as a parameter in your macro or just
direcly name the range to print.

I prefer the custom views method because you can hide rows and columns within
one print range.


Gord Dibben MS Excel MVP

On Thu, 4 Jan 2007 11:36:01 -0800, zip82dah
wrote:

I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges so
the users can just select PrintArea1 or PrintArea2?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 152
Default Excel - I want to predefine more than one print area option -

The code below automatically sets the print area (1 to 7 pages) based on 1
cell in each page being populated. You must start at the last page and work
back (the first page is always populated). Page 1 is not always required, the
first if statement determines whether to print page 1 or not. A separate
macro hides page 1 if not required.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Set Sheets to Print
Application.ScreenUpdating = False
If Range("InstrmntTP7") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg7"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg7"
End If
ElseIf Range("InstrmntTP6") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg6"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg6"
End If
ElseIf Range("InstrmntTP5") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg5"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg5"
End If
ElseIf Range("InstrmntTP4") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg4"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg4"
End If
ElseIf Range("InstrmntTP3") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg3"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg3"
End If
ElseIf Range("InstrmntTP2") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg2"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2"
End If
ElseIf Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1"
Else: Cancel = True
End If
Application.ScreenUpdating = True
End Sub

I think you can easily adapt this to meet your needs.
Lou


"Gord Dibben" wrote:

You can use ViewCustom Views to set up two different print ranges for your
users to pick from.

Or you could use a macro to print a selected range

You can use the name of the custom view as a parameter in your macro or just
direcly name the range to print.

I prefer the custom views method because you can hide rows and columns within
one print range.


Gord Dibben MS Excel MVP

On Thu, 4 Jan 2007 11:36:01 -0800, zip82dah
wrote:

I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges so
the users can just select PrintArea1 or PrintArea2?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 152
Default Excel - I want to predefine more than one print area option -

I overlooked something that may cause you fits. Pg1 is a named range
(A14:AU57). As are all pages (named).
An equivalent formula to "ActiveSheet.PageSetup.PrintArea = "Pg1:Pg7"" is
ActiveSheet.PageSetup.PrintArea = "A1:AU327"
Lou

"Rookie 1st class" wrote:

The code below automatically sets the print area (1 to 7 pages) based on 1
cell in each page being populated. You must start at the last page and work
back (the first page is always populated). Page 1 is not always required, the
first if statement determines whether to print page 1 or not. A separate
macro hides page 1 if not required.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Set Sheets to Print
Application.ScreenUpdating = False
If Range("InstrmntTP7") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg7"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg7"
End If
ElseIf Range("InstrmntTP6") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg6"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg6"
End If
ElseIf Range("InstrmntTP5") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg5"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg5"
End If
ElseIf Range("InstrmntTP4") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg4"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg4"
End If
ElseIf Range("InstrmntTP3") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg3"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2:Pg3"
End If
ElseIf Range("InstrmntTP2") < "" Then
If Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1:Pg2"
Else
ActiveSheet.PageSetup.PrintArea = "Pg2"
End If
ElseIf Range("StndrdTP1") < "" Then
ActiveSheet.PageSetup.PrintArea = "Pg1"
Else: Cancel = True
End If
Application.ScreenUpdating = True
End Sub

I think you can easily adapt this to meet your needs.
Lou


"Gord Dibben" wrote:

You can use ViewCustom Views to set up two different print ranges for your
users to pick from.

Or you could use a macro to print a selected range

You can use the name of the custom view as a parameter in your macro or just
direcly name the range to print.

I prefer the custom views method because you can hide rows and columns within
one print range.


Gord Dibben MS Excel MVP

On Thu, 4 Jan 2007 11:36:01 -0800, zip82dah
wrote:

I am working with new Excel users. I have a worksheet that sometimes needs
one print range and sometimes another. How can I predefine those ranges so
the users can just select PrintArea1 or PrintArea2?



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
setting print area to selected cells [email protected] Excel Discussion (Misc queries) 4 November 30th 06 09:29 PM
Excel; how do I print titles in 'Setup' when option greyed out? MLB Excel Worksheet Functions 0 December 28th 05 03:22 PM
Extra Row in Defined Print Area Harry Gordon Excel Discussion (Misc queries) 3 November 14th 05 03:06 AM
Why do I get a print error light trying to print an excel sheet ? SMC Excel Discussion (Misc queries) 2 November 5th 05 01:36 AM
how to remove print option in a particular excel file excel Excel Discussion (Misc queries) 1 March 14th 05 11:44 AM


All times are GMT +1. The time now is 10:04 AM.

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

About Us

"It's about Microsoft Excel"