Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Printing (Selecting)
Hi there,
I currently print an array of worksheets from within my code, what I would like do is check a condition on each page before it is added to the array? Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6", "Sheet7", Sheet8", "Sheet9")).Select Sheets("Sheet1").Activate ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True At certain time I would like to exclude various sheets? Is this possible? or do I have to write code for each possible array condition? Thanks Craig |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Printing (Selecting)
Craig,
I used the following sub with the assumption that if Cell A1 was not blank then print that sheet and loop through all sheets in the workbook checking if cell A1 was not blank and it would print those sheets where A1 was not blank. So you could change the conditions for printing based on whatever criteria you want to use, assuming it is looking at the same thing on each sheet. Sub PrintTest() Dim ShtNum As Integer For ShtNum = 1 To Sheets.Count If Worksheets(ShtNum).Cells(1, 1) < "" Then Worksheets(ShtNum).PrintOut End If Next ShtNum End Sub HTH Wally Steadman (New Guy Learning) "Craig" wrote in message news:G_4Bd.625387$nl.219427@pd7tw3no... Hi there, I currently print an array of worksheets from within my code, what I would like do is check a condition on each page before it is added to the array? Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6", "Sheet7", Sheet8", "Sheet9")).Select Sheets("Sheet1").Activate ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True At certain time I would like to exclude various sheets? Is this possible? or do I have to write code for each possible array condition? Thanks Craig |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array formulas/selecting data | Excel Worksheet Functions | |||
Vlookup - Array not selecting in other workbook | Excel Discussion (Misc queries) | |||
printing out via vb and selecting the printer | Excel Programming | |||
selecting multiple sheets by use of an array? | Excel Programming | |||
Help: selecting part of an array | Excel Programming |