简体   繁体   中英

Run Macro Based On Worksheet Change (Cell Contains Formula)

I think I have a fairly reasonable/standard ask and the methods I've tried thus far have proved unsuccessful.

I'm running Excel 2013 32-Bit and in Sheet 6 in Cell J7 I have a third-party formula that changes every so often. Basically I'd like to call a macro every time that cell value changes.

Keeping in mind that this cell is a formula (I've played around with changing this third party formula to a straightforward formula such as A1+B1 and it hasn't changed the behaviour).

Basically Excel does not call my macro and recognize the change in this cell unless I manually type over the formula or press F2 in the Excel cell and hit Enter or if I click into the Formula box and press enter (all steps require a user click).

Here are the methods I've tried (all are a variation of Worksheet Change or Worksheet Calculation). If there is something glaring I'm missing or a method I have not tried please advise, thanks.

https://www.extendoffice.com/documents/excel/4423-excel-run-macro-on-cell-change.html

http://www.dbforums.com/showthread.php?1661517-Execute-Macros-From-Formulas-(Or-Cell-Value)

How can I run a VBA code each time a cell get is value changed by a formula?

https://www.linkedin.com/pulse/20140623100408-92734594-how-to-execute-excel-vba-macro-on-change-of-specific-cell-in-excel-sheet

https://www.excelforum.com/excel-programming-vba-macros/400984-change-in-cell-from-formula-to-auto-run-a-macro.html

http://www.ozgrid.com/forum/showthread.php?t=144429

Run VBA Script When Cell Value Change by Formula

VBA code doesn't run when cell is changed by a formula

Trigger macro when any cell containing formula changes

automatically execute an Excel macro on a cell change

So it looks like this third party add-in has an event that I could use to provide the same end goal. It does not activate on that worksheet change, but it provides the solution I'm looking for.

It is an AFTER_REFRESH event, meaning when a REFRESH is triggered via the third-party ribbon it will run my vba as I wanted to happen.

Thanks all for your thoughts/input.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM