Hello

I have the below code in a worksheet

Private Sub Worksheet_Calculate()
If [m5] = 40 Then
Call print_PAB30
End If
End Sub
It works as required, but too well. While ever M5=40 it runs printPAB30 constantly, as it should.

What can I do to the code to make it run once, when M5=40, then wait till m5 value changes, before looking for 40 in m5 again and running printPAB30 again when M5 reaches 40.

Cheers