View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shannon Shannon is offline
external usenet poster
 
Posts: 2
Default need a function (not macro with ontime) to record a snapshot of a changing cell

Cell A1 = current time
Cell A2 = time at which I would like a snapshot
Cell A3 = a constantly changing value (like a volatile rand() or a
stock price during the day)
Cell A4 = once the snapshot time is reached, a non changing value
equal to the value of A3 at the snapshot time

I wrote a funtion that worked, but only by using module level
variables. Because this function is called fom many cells, each cell
needed its own variables. This was impractical. Would have needed
2,000 seperate functions.

All other functions i have written with if-then statements return 0
after the current time exceeds the snapshot time.

I know there is probably a simple solution, but my brain is currently
in manual-only calculation mode.

Thanks for the help.