Macro to run when formula result changes

scarlett3

Board Regular
Joined
Jan 21, 2005
Messages
73
Office Version
  1. 365
Platform
  1. Windows
Hi

I have an IF formula in cell B9 then either returns "N" or "Y" as the result. I've read that a macro cannot be run based on changed in formula results, but is there a workaround to this?

I'd like the macro to run if the formula result changes from "N" to "Y".

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
What is this formula in B9?
Do you only want it to run the first time it changes from "N" to "Y"?
 
Upvote 0
It's a simple =IF(H6>H1,"Y","N") formula.

Yes, I suppose I would only want it to run the macro once, just in case the various cell values changed so that it alternated between "Y" and "N".
 
Upvote 0
So, how are the values in H6 and H1 changed?
User Input? Data Import?, Formula? If Formula, what is it?

lenze
 
Upvote 0
H1 is a fixed value; H6 is a value from a data import which refreshes every second.
 
Upvote 0
Sounds like you might want to use the Worksheet_Calculate Event Procedure.

Chip Pearson did a nice write-up on them a few years ago: http://www.cpearson.com/excel/Events.aspx

You can also find some good examples if you search this forum for "Worksheet_Calculate".
 
Upvote 0

Forum statistics

Threads
1,214,629
Messages
6,120,630
Members
448,973
Latest member
ChristineC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top