Description
This might seem like an oddly specific inspection, but I'm finding myself dropping comments like this one on SO with increasing frequency:
You're getting into an infinite loop because you're changing the worksheet from inside the Change event. Use Application.EnableEvents = false before you make changes, then set it back to True when you're done.
The code below will lock up Excel the first time it executes:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Value = "Foo"
End Sub
Obviously this is a contrived example (and an inspection would need some code path analysis), but RD should be able to tell if a Range.Value
unambiguously is on the same worksheet and is not wrapped in a non-deterministic Application.EnableEvents = True
and Application.EnableEvents = False
call pair. The only instance that might be trickier is if there is a custom re-entry flag.