Run macro when when changing cell value with formula.

  • Thread starter Thread starter Kollijonke
  • Start date Start date
K

Kollijonke

Hi.
I am running a workbook that getting it´s values from a different program.
This program is "putting" the data into the workbook. In this data there is a
countdown clock that counts down to "take off" for a race.
I have a IF formula in Excel to get out the value"logg", in cell E28, if the
value in the countdown clock is below 00:00:30
and value "not" if it´s anything else. This values is linked to another
workbook, in cell M1.

When this value is changing from "not" to "logg" i want to run "Macro1" that
copy specific data from A1:H10 fromthe first workbook to the other with a
offset so the data is been pasting in after each other.
I have tried with sub change and selection change codes that i found in here
but the only thing that happens is that the dialog window for the macro is
popping up.
I also tried with the calculate sub and it works but it´s keep running every
second and pasting in the data over and over again until the value in cell M1
is changing to "not" .

I hope anyone can help me with this.
 
You can't stop the caculate event from running, but you can use another cell
to determine if the data has been written.

Set cell A1 to False before starting the timer


In the calculate function do this

if Range("A1") = false

if Range("E28") < timevalue("00:00:30") then
'enter you copy code here
Range("A1") = True
end if
end if
 
Hi.
Thanks for the answer, but i dont know how to set the cells to false. The
problem is that the data is pasted into different rows for each time. Like
A1:H10, A12:H10, A22:H10 and so on.
It´s around 70-100 times each day this copy event happens

Thanks again.
 
Back
Top