how can I insert a macro into a boolean statement

D

Don Guillett

right click sheet tab>view code>insert this and enter =now() somewhere on
the sheet but be aware it will fire each time anything is calculated on the
sheet. You might prefer a worsheet_change event restricted to only cell c4

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
If Range("c4") < Range("c5") Then MsgBox "HI"
Application.EnableEvents = True
End Sub
 
Top