Macro not running when cell value is updated

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I want to run a macro when a cell value changes. I have the following
code to do this:

Private Sub WorkSheet_Change(ByVal Target As Range)

If Target.Address = "$E$5" And Target.Value = 1 Then
Call Archive
End If

End Sub

When I manually enter a 1 into cell E5, the macro runs fine. However,
E5 normally contains =IF(G5=5,1,0) so when G5 is 5, E5 is changed to 1
(auto calculate is on) but my macro does not run when this happens. It
will only run when I manually enter 1 or when I click the formula and
press enter to accept it. Why is my macro not running?
 
Hello Jon,

This event doesn't occur when cells change during a recalculation. Use
the Calculate event to trap a sheet recalculation. This event isn't
triggered either when cells are deleted.

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top