You need to connect to Worksheet_Change event .
Something like this should start you up:
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = "OVER" Then MsgBox "Cell " & Target.Address & " crosses OVER" ElseIf Target.Value = "UNDER" Then MsgBox "Cell " & Target.Address & " crosses UNDER" End If End Sub Sub just_testing() Dim mycell As Object Set mycell = ActiveSheet.Cells(1, 1) Call Worksheet_Change(mycell) End Sub
Using this code, changing the value of cell A1 to OVER (case sensitive!) Will print the message "Cell $ A $ 1 crosses OVER."
Edit based on additional information provided by OP:
For automatic sheet changes, you need to use the Worksheet_Calculate event (example below). For some strange reason, Excel seems like you have =NOW() anywhere in the worksheet for Worksheet_Calculate to actually run.
Private Sub Worksheet_Calculate() Dim mycell As Object Set mycell = ActiveSheet.Cells(1, 1) If mycell.Value = "OVER" Then MsgBox "Cell " & mycell.Address & " crosses OVER" ElseIf mycell.Value = "UNDER" Then MsgBox "Cell " & mycell.Address & " crosses UNDER" End If End Sub
source share