Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
bennyob
 
Posts: n/a
Default select sheets for printing

Can anyone tell me how to select sheets in a workbook based on a cell value
for printing?
I have many sheets, I want to select all the sheets that have a value
greater than 0 in C2 for printing, which I guess will then go something like:
ActiveWindow.SelectedSheets.PrintOut
Thanks in advance for help
Benny

  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default select sheets for printing

bennyob, try this,

Sub Print_sheets()
'will print sheet with a vavle 0 in C2
For Each Sheet In ThisWorkbook.Worksheets
Sheet.Activate
If Range("C2").Value 0 Then

'use this to test and comment out below
ActiveSheet.PrintPreview

'use this to print
'ActiveSheet.PrintOut Copies:=1, Collate:=False

End If
Next
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"bennyob" wrote in message
...
Can anyone tell me how to select sheets in a workbook based on a cell

value
for printing?
I have many sheets, I want to select all the sheets that have a value
greater than 0 in C2 for printing, which I guess will then go something

like:
ActiveWindow.SelectedSheets.PrintOut
Thanks in advance for help
Benny



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
Autofilter Lists across Multiple Sheets, Maintain Correct Referenc EDSTAFF Excel Worksheet Functions 0 November 14th 05 03:27 PM
enhanced conditional formatting Stuart Excel Discussion (Misc queries) 13 November 13th 05 07:20 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM
Finding specific sheets within a workbook Roy Excel Discussion (Misc queries) 2 August 23rd 05 06:40 PM
Spellnumber Norman Jones Excel Worksheet Functions 6 December 13th 04 07:21 AM


All times are GMT +1. The time now is 11:39 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"