Forum Discussion
fwreden
Oct 26, 2025Copper Contributor
Excel/VBA Worksheet_Change function running old version
I wrote a Worksheet_Change function initially. It worked. If I entered an incorrect value I got an error message, let's say the msgbox said "Error: A". Then I changed the error message to read "Erro...
NikolinoDE
Oct 28, 2025Platinum Contributor
What you’re experiencing is almost always not Excel showing a ghost old version, but rather some subtle issue with how the Worksheet_Change event is being triggered or where the code actually resides.
You can add a simple Debug.Print to confirm exactly which code is running:
Private Sub Worksheet_Change(ByVal Target As Range)
Debug.Print "Worksheet_Change fired"
MsgBox "Error B"
End SubIf you see "Worksheet_Change fired", the code is being executed.
If you still see “Error: A”, then some other code or add-in is interfering.
Otherwise it would be helpful if the VBA code was included.