Reputation: 37
I would like to have macro called 2 seconds after a cell changes.
I am stuck with this code.
Any help would be appreciated.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("B2")) Is Nothing Then
Application.OnTime Now + TimeValue("00:00:02"), Macro
End Sub
Upvotes: 1
Views: 110
Reputation: 2568
This is how you should modify your code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("B2")) Is Nothing Then
Application.Wait(Now + TimeValue("0:00:02"))
Call Macro
End If
End Sub
Upvotes: 2