Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Print conditional worksheets
I would like to print worksheets depending on the value of B2 (in Sheet1).
If B2 = "pens" or "paper" Then print Sheet1, Sheet3 and Sheet4 If B2 = "pencils" Then print Sheet1, Sheet5 Any suggestions on how to do this? Thanks in advance. |
#2
|
|||
|
|||
Hi
Try this macro Sub Tetst() With Sheets("Sheet1") If .Range("B2") = "pens" Or .Range("B2") = "paper" Then Sheets(Array("Sheet1", "Sheet3", "Sheet4")).PrintOut ElseIf .Range("B2") = "pencils" Then Sheets(Array("Sheet1", "Sheet5")).PrintOut End If End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "jhicsupt" wrote in message ... I would like to print worksheets depending on the value of B2 (in Sheet1). If B2 = "pens" or "paper" Then print Sheet1, Sheet3 and Sheet4 If B2 = "pencils" Then print Sheet1, Sheet5 Any suggestions on how to do this? Thanks in advance. |
#3
|
|||
|
|||
Untested, but try this
Sub conditional_print_sheets() If Range("B2").Value = "pens" Then Worksheets("Sheet3").PrintOut Worksheets("Sheet4").PrintOut ElseIf Range("B2").Value = "paper" Then Worksheets("Sheet3").PrintOut Worksheets("Sheet4").PrintOut ElseIf Range("B2").Value = "penclis" Then Worksheets("Sheet4").PrintOut End If End Sub -- Ian -- "jhicsupt" wrote in message ... I would like to print worksheets depending on the value of B2 (in Sheet1). If B2 = "pens" or "paper" Then print Sheet1, Sheet3 and Sheet4 If B2 = "pencils" Then print Sheet1, Sheet5 Any suggestions on how to do this? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print all charts in a workbook (multiple worksheets) | Charts and Charting in Excel | |||
Print order of worksheets | Excel Discussion (Misc queries) | |||
Print mult worksheets to Adobe | Excel Discussion (Misc queries) | |||
What is the simplest way to print multiple worksheets? | Charts and Charting in Excel | |||
How can I print a specified page from several worksheets in Exce. | Excel Worksheet Functions |