ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Macro (https://www.excelbanter.com/excel-discussion-misc-queries/86922-excel-macro.html)

jatman

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


Don Guillett

Excel Macro
 

If .Range("D1") < "[Ctrl] ;" And range("F57") = "0.00" Then

--
Don Guillett
SalesAid Software

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




Don Guillett

Excel Macro
 
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

"Don Guillett" wrote in message
...

If .Range("D1") < "[Ctrl] ;" And range("F57") = "0.00" Then

--
Don Guillett
SalesAid Software

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







All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com