Hi,
I want to put a certain statement into a cell if some other statement is true, but if it is not true I just want to wait until it is true (until this cell changes its value so that the condition is met)
At first I used the macro recorder, and I got this:
Range("L9").Select
ActiveCell.FormulaR1C1 = "=IF(R[-8]C[-5]<>""play"","""",""yee"")"
A few questions here:
1) Can I change the R[-8]C[-5] to just the cells name? Like just G1? I tried this but got an error. I guess this can be done?
2) What this is supposed to do is this: if cell G1 is not equal to play, then just wait until it is. I'm using a program that updates cells values in excel continuous in time(or like every 0.5 second). So at first I tried to use a While-loop but excel saw that as an infinite loop and froze and I had to break, the thing is that I want to start the macro and have it running and it might take like 30 minutes until cell G1 becomes equal to play. Excel did not like a loop that long (using while, do until, do while, etc.). So the thing is I guess to use these "" to make it wait for it. Then when G1 equals play only then do I want to put another statement into another cell, this is where ""yee"" is above. Should I just write that where ""yee"" is? If so how do I write it? In this case ""yee"" should be:
Range("L11").Select
ActiveCell.FormulaR1C1 = "=IF(R[-2]C[-4]<1.25,""LAY"","""")"
Got an error when I tried to write this in where ""yee"" is.
I use the ActiveCell.FormulaR1C1 because I wanted to put the entire formula into the cell to be able to use "" as "loops" instead if the While-loops that just froze excel.
Sorry if this was confusing! I have never worked with cells that update automatically before!
Thanks!
/Dan
I want to put a certain statement into a cell if some other statement is true, but if it is not true I just want to wait until it is true (until this cell changes its value so that the condition is met)
At first I used the macro recorder, and I got this:
Range("L9").Select
ActiveCell.FormulaR1C1 = "=IF(R[-8]C[-5]<>""play"","""",""yee"")"
A few questions here:
1) Can I change the R[-8]C[-5] to just the cells name? Like just G1? I tried this but got an error. I guess this can be done?
2) What this is supposed to do is this: if cell G1 is not equal to play, then just wait until it is. I'm using a program that updates cells values in excel continuous in time(or like every 0.5 second). So at first I tried to use a While-loop but excel saw that as an infinite loop and froze and I had to break, the thing is that I want to start the macro and have it running and it might take like 30 minutes until cell G1 becomes equal to play. Excel did not like a loop that long (using while, do until, do while, etc.). So the thing is I guess to use these "" to make it wait for it. Then when G1 equals play only then do I want to put another statement into another cell, this is where ""yee"" is above. Should I just write that where ""yee"" is? If so how do I write it? In this case ""yee"" should be:
Range("L11").Select
ActiveCell.FormulaR1C1 = "=IF(R[-2]C[-4]<1.25,""LAY"","""")"
Got an error when I tried to write this in where ""yee"" is.
I use the ActiveCell.FormulaR1C1 because I wanted to put the entire formula into the cell to be able to use "" as "loops" instead if the While-loops that just froze excel.
Sorry if this was confusing! I have never worked with cells that update automatically before!
Thanks!
/Dan