Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
setting print area to selected cells | Excel Discussion (Misc queries) | |||
Excel; how do I print titles in 'Setup' when option greyed out? | Excel Worksheet Functions | |||
Extra Row in Defined Print Area | Excel Discussion (Misc queries) | |||
Why do I get a print error light trying to print an excel sheet ? | Excel Discussion (Misc queries) | |||
how to remove print option in a particular excel file | Excel Discussion (Misc queries) |