View Single Post
  #4   Report Post  
Sam Spade Sam Spade is offline
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by Sam Spade View Post
I believe you are correct. As soon as the “False” condition exists the values arrived at through the formulas in each cell is lost. I’ve never done a VBA macro before so bare with me. When you mentioned “constant values”, could these values be derived by the same math used in the existing cell formulas?
As a simple example, lets say I’m using the following formula in cell F5:
( =IF (D5=30, (M5/(M4+M3))

So when D5 is “True” at the 30 minute interval whatever the values are at that time in cells M3, M4, and M5 will enter the formula and provide a new value result in cell F5 (that I want to keep). As each new time interval arrives the values in the “M” will also change and produce another new value in F5.

My thinking was to dedicate a series of cells for each time interval so that the result from each interval is retained and wouldn’t get lost or overwritten by each succeeding interval.

Could you inform me as to how a VBA macro would handle something like this?
Thanks
FOLLOW UP:
I just read through an interesting VBA tutorial on creating and using Custom Functions. If I’m not mistaken it looks like I might be able create the “constant value” you mentioned as each Time Interval arrives. This constant value would then be inserted into a designated cell. This way each of the existing dependent Formula cells (F5, F6, F7, etc.) would refer to that cell value instead of continually changing Time cell (D5).

As long as the value remains constant I should never lose the data created. I guess I'll also have to incorporate a way to reset the constant values (to maybe "0") after an entire Timing cycle is completed.
Does that sound about right?