Excel Macro

J

jatman

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
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top