the macro that i is:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = quot;DSRquot; Then
Cancel = True
Application.EnableEvents = False
With ActiveSheet
If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; 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 quot;F57quot; must equal 0.00 before print out also. i tried
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = quot;DSRquot; Then
Cancel = True
Application.EnableEvents = False
With ActiveSheet
If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And (quot;F57quot;) = quot;0.00quot; 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
If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And range(quot;F57quot;) = quot;0.00quot; Then
--
Don Guillett
SalesAid Software
quot;jatmanquot; gt; wrote in message
...
gt; the macro that i is:
gt;
gt; Private Sub Workbook_BeforePrint(Cancel As Boolean)
gt; If ActiveSheet.Name = quot;DSRquot; Then
gt; Cancel = True
gt; Application.EnableEvents = False
gt; With ActiveSheet
gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; Then
gt; .PrintOut
gt; End If
gt; End With
gt; Application.EnableEvents = True
gt; End If
gt; End Sub
gt;
gt; i would like to change it so that another condition is also met.
gt;
gt; Cell quot;F57quot; must equal 0.00 before print out also. i tried
gt;
gt; Private Sub Workbook_BeforePrint(Cancel As Boolean)
gt; If ActiveSheet.Name = quot;DSRquot; Then
gt; Cancel = True
gt; Application.EnableEvents = False
gt; With ActiveSheet
gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And (quot;F57quot;) = quot;0.00quot; Then
gt; .PrintOut
gt; End If
gt; End With
gt; Application.EnableEvents = True
gt; End If
gt; End Sub
gt;
gt; it is not as easy as i had hoped - suggestions?
gt;
gt; jat jaswal
gt;
Pls don't use private email of posters unless invited. Try
gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And range(quot;F57quot;) = quot;0.00quot; Then
If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And range(quot;F57quot;) = 0 Then
--
Don Guillett
SalesAid Software
quot;Don Guillettquot; gt; wrote in message
...
gt;
gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And range(quot;F57quot;) = quot;0.00quot; Then
gt;
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;jatmanquot; gt; wrote in message
gt; ...
gt;gt; the macro that i is:
gt;gt;
gt;gt; Private Sub Workbook_BeforePrint(Cancel As Boolean)
gt;gt; If ActiveSheet.Name = quot;DSRquot; Then
gt;gt; Cancel = True
gt;gt; Application.EnableEvents = False
gt;gt; With ActiveSheet
gt;gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; Then
gt;gt; .PrintOut
gt;gt; End If
gt;gt; End With
gt;gt; Application.EnableEvents = True
gt;gt; End If
gt;gt; End Sub
gt;gt;
gt;gt; i would like to change it so that another condition is also met.
gt;gt;
gt;gt; Cell quot;F57quot; must equal 0.00 before print out also. i tried
gt;gt;
gt;gt; Private Sub Workbook_BeforePrint(Cancel As Boolean)
gt;gt; If ActiveSheet.Name = quot;DSRquot; Then
gt;gt; Cancel = True
gt;gt; Application.EnableEvents = False
gt;gt; With ActiveSheet
gt;gt; If .Range(quot;D1quot;) lt;gt; quot;[Ctrl] ;quot; And (quot;F57quot;) = quot;0.00quot; Then
gt;gt; .PrintOut
gt;gt; End If
gt;gt; End With
gt;gt; Application.EnableEvents = True
gt;gt; End If
gt;gt; End Sub
gt;gt;
gt;gt; it is not as easy as i had hoped - suggestions?
gt;gt;
gt;gt; jat jaswal
gt;gt;
gt;
gt;
- Jan 24 Wed 2007 20:35
Excel Macro
close
全站熱搜
留言列表
發表留言