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 / Programming / March 2006

Tip: Looking for answers? Try searching our database.

excel print functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jatman - 22 Mar 2006 20:05 GMT
i have a template made up and that part works and looks good.  i need a macro
that not print unless the value is true.  (ex. if the value in cell a1 = bbb,
it will not print indicating an error on the worksheet.

thank you,

jatman
Ron de Bruin - 22 Mar 2006 21:23 GMT
You can copy this in the Thisworkbook module for a sheet named Sheet1

Private Sub Workbook_BeforePrint(Cancel As Boolean)
   If ActiveSheet.Name = "Sheet1" Then
       Cancel = True
       Application.EnableEvents = False
       With ActiveSheet
           If .Range("A1") = "bbb" Then
               .PrintOut
           End If
       End With
       Application.EnableEvents = True
   End If
End Sub

Signature

Regards Ron de Bruin
http://www.rondebruin.nl

>i have a template made up and that part works and looks good.  i need a macro
> that not print unless the value is true.  (ex. if the value in cell a1 = bbb,
[quoted text clipped - 3 lines]
>
> jatman
 
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.