Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
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
Array formulas/selecting data Kalle Excel Worksheet Functions 2 July 14th 09 10:52 AM
Vlookup - Array not selecting in other workbook Erinayn Excel Discussion (Misc queries) 0 March 21st 07 03:03 PM
printing out via vb and selecting the printer HCS Excel Programming 1 October 19th 04 06:04 PM
selecting multiple sheets by use of an array? anhjan[_3_] Excel Programming 3 April 8th 04 01:58 AM
Help: selecting part of an array Philbyinsydney Excel Programming 1 March 5th 04 01:15 AM


All times are GMT +1. The time now is 09:22 PM.

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

About Us

"It's about Microsoft Excel"