View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default excel print functions

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



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


"jatman" wrote in message ...
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