View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default stop a macro from running everytime a cell is changed

The argument Target is the cell that just changed, so you want something like

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$FE$11" and Target.Value = 1 Then
MsgBox "VEHICLE MAY BE DUE FOR A SERVICE !!", vbBEEP + vbOKOnly
End If

End Sub


--
HTH...

Jim Thomlinson


"bassfisher" wrote:

i am running the following macro,

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("FE11") = 1 Then
MsgBox "VEHICLE MAY BE DUE FOR A SERVICE !!", vbBEEP + vbOKOnly
End If

End Sub

i am a newbie to programming and can't figure out how to stop it from
running everytime any cell value is changed in the worksheet other than
"FE11" !
also i would like to add the date due in the message box if possible that is
a reult of cell "FE12".

any help would be aprreciated

thanks in advance

bassfisher