• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Target with worksheet_calculate

AEGuy

New Member
Hi everyone,


I am trying write a code that will perform an action when the value of a specific cell changes with an excel formula. In order for it to execute properly, the code needs to be passed the cell that changed value.

I can easily do this using
Code:
 worksheet_change(ByVal Target as Range)
and using the target object, but I am trying to get the sub to execute when a formula changes the value of the cell, and I can't find an analogous object using
Code:
 worksheet_calculate()
.

Is there something that I am missing? I'm sorry if there is a straightforward answer; I'm fairly new to VBA.
 
There is no such object. The entire sheet calculates, not a specific cell. Typically, you either store the old value of the cell(s) of interest, and then check those in the Calculate event to see if they have changed, or you monitor the input cells for the formulas using a Change event.
 
Back
Top