1

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
Mrig
  • 11,612
  • 2
  • 13
  • 27
alex
  • 37
  • 2
  • 7
  • 2
    It has been answered before, please check the following link: http://stackoverflow.com/a/7549732/2854647 – Maki Jun 01 '16 at 07:51

1 Answers1

2

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
ib11
  • 2,530
  • 3
  • 22
  • 55