Thread: Excel Macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
jatman
 
Posts: n/a
Default Excel Macro

the macro that i is:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "DSR" Then
Cancel = True
Application.EnableEvents = False
With ActiveSheet
If .Range("D1") < "[Ctrl] ;" Then
.PrintOut
End If
End With
Application.EnableEvents = True
End If
End Sub

i would like to change it so that another condition is also met.

Cell "F57" must equal 0.00 before print out also. i tried

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "DSR" Then
Cancel = True
Application.EnableEvents = False
With ActiveSheet
If .Range("D1") < "[Ctrl] ;" And ("F57") = "0.00" Then
.PrintOut
End If
End With
Application.EnableEvents = True
End If
End Sub

it is not as easy as i had hoped - suggestions?

jat jaswal