Macro to run when formula result changes

scarlett3

Board Regular
Joined
Jan 21, 2005
Messages
67
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!
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,108
Office Version
365
Platform
Windows
What is this formula in B9?
Do you only want it to run the first time it changes from "N" to "Y"?
 

scarlett3

Board Regular
Joined
Jan 21, 2005
Messages
67
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".
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
So, how are the values in H6 and H1 changed?
User Input? Data Import?, Formula? If Formula, what is it?

lenze
 

scarlett3

Board Regular
Joined
Jan 21, 2005
Messages
67
H1 is a fixed value; H6 is a value from a data import which refreshes every second.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,108
Office Version
365
Platform
Windows
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".
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,197
Messages
5,509,748
Members
408,752
Latest member
KrisF

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top