Excel Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Pls don't use private email of posters unless invited. Try
If .Range("D1") <> "[Ctrl] ;" And range("F57") = "0.00" Then
If .Range("D1") <> "[Ctrl] ;" And range("F57") = 0 Then

--
Don Guillett
SalesAid Software
(e-mail address removed)
Don Guillett said:
If .Range("D1") <> "[Ctrl] ;" And range("F57") = "0.00" Then

--
Don Guillett
SalesAid Software
(e-mail address removed)
jatman said:
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
 
Back
Top