Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Printing / July 2007

Tip: Looking for answers? Try searching our database.

Conditional Printing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mos.StaLL@gmail.com - 19 Jul 2007 19:26 GMT
Hi,

I would like to know if anyone has any vb script to contionally print
worksheets if a particular cell is > 0.  I currently have 25 - 30
worksheets in a workbook and I plan on adding on more sheet to
reference the same cell in each worksheet.  If the cell is greater
than 0, I want it to print out that worksheet via a macro assign to a
button.  Thanks.

James
squenson - 29 Jul 2007 06:45 GMT
This macro only prints the sheets that have the value 8 in cell A1. Adapt to
your needs!

Sub PrintOnlySomeSheets()

   For Each s In Sheets
   
       If s.Cells(1, 1) = 8 Then    ' <--- Adapt the cell position and value
to your needs
           Sheets(s.Name).Select
           ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
       End If
       
   Next

End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.