Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Print Macro
I'm new to Macro's in Excel - but trainable
If cell xx has "AA" - I want to print range1 and range2 If cell xx has "BB" - I want to print range3 and range4 If cell xx has "CC" - I want to print range5 and range6 I would like to have a button that says "print" when the user is ready How do I do this? Thanks in advance for helping |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Print Macro
First, if you print discontiguous ranges, you'll get at least two sheets of
paper from your printer. Option Explicit Sub testme01() With ActiveSheet Select Case UCase(.Range("a1").Value) Case Is = "AA" .Range("a1:b9,e12:f13").PrintOut preview:=True Case Is = "BB" .Range("a2:b33,e33:f33").PrintOut preview:=True Case Is = "BB" .Range("a3:b21,e22:f23").PrintOut preview:=True Case Else MsgBox "what should happen here?" End Select End With End Sub Brad wrote: I'm new to Macro's in Excel - but trainable If cell xx has "AA" - I want to print range1 and range2 If cell xx has "BB" - I want to print range3 and range4 If cell xx has "CC" - I want to print range5 and range6 I would like to have a button that says "print" when the user is ready How do I do this? Thanks in advance for helping -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Print Macro
Ps. Put a button from the Forms toolbar on that worksheet. Make the caption
"Print" and assign that macro to that button. Brad wrote: I'm new to Macro's in Excel - but trainable If cell xx has "AA" - I want to print range1 and range2 If cell xx has "BB" - I want to print range3 and range4 If cell xx has "CC" - I want to print range5 and range6 I would like to have a button that says "print" when the user is ready How do I do this? Thanks in advance for helping -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Print Macro
Thank you for your help.
Since the ranges that I was going to print weren't on the active worksheet - I removed the period in front of the range command and got it to work. Is that the proper way to do it - or did I just get lucky. The comma between print ranges didn't work for me - I had to split it between two lines (is that because the ranges were full pages?) Got the button to work - pretty slick Thanks again! "Dave Peterson" wrote: First, if you print discontiguous ranges, you'll get at least two sheets of paper from your printer. Option Explicit Sub testme01() With ActiveSheet Select Case UCase(.Range("a1").Value) Case Is = "AA" .Range("a1:b9,e12:f13").PrintOut preview:=True Case Is = "BB" .Range("a2:b33,e33:f33").PrintOut preview:=True Case Is = "BB" .Range("a3:b21,e22:f23").PrintOut preview:=True Case Else MsgBox "what should happen here?" End Select End With End Sub Brad wrote: I'm new to Macro's in Excel - but trainable If cell xx has "AA" - I want to print range1 and range2 If cell xx has "BB" - I want to print range3 and range4 If cell xx has "CC" - I want to print range5 and range6 I would like to have a button that says "print" when the user is ready How do I do this? Thanks in advance for helping -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Print Macro
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Macro to open print window and set to print entire workbook | Excel Discussion (Misc queries) | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming | |||
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook | Excel Programming |