Print Macro


Posted by Bob Thuli on January 22, 2002 7:25 PM

I would like to create a macro that would only print if a cell has a certain value. Is there a way to do this? Your help is greatly appreciated.



Posted by Bruno on January 23, 2002 1:50 AM

Hi Bob,
Say you only want to print a sheet when the value of cell A1 is greater then 50.
You could use code like this :

Sub PrintIf()
If Range("A1") < 50 Then
MsgBox "Sorry, printing not allowed"
Else
ActiveSheet.PrintOut
End If
End Sub

Bruno
-----