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

Shannon,

You can want a function, but you won't get one. You need to use macros with
ontime to force constant recalculation or you won't have any luck with this.

To help you change your mind, I promise that the macro will work will all
your cells, and not require that each cell have its own variables.

Waiting for your decision,
Bernie
MS Excel MVP


"Shannon" wrote in message
om...
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.