PDA

View Full Version : Preventing a Formula from Executing



Cyberdude
03-12-2006, 08:39 PM
I know absolutely nothing about the subject of protection (I never needed it). So I was wondering if I can use it to prevent a formula from executing. I could make good use of a formula that displays the current date and time in a cell, but doesn't execute after that until I say it's OK. Can the protection facility be used somehow to lock and unlock the formula, thereby preventing it from updating the date/time every time the sheet is recalculated? :bug:

Jacob Hilderbrand
03-12-2006, 08:47 PM
You can make calculations manual instead of automatic, that way the formulas will only update when you do it. But it will be for all formulas.

Alternately, Ctrl + ; will put the date in a cell and Ctrl + Shift + : will put the time in a cell.

Or you could make a macro to put the data in, and just use a hotkey to run it when you want.

Cyberdude
03-12-2006, 09:20 PM
I presume from your answer that protection mechanisms aren't the answer. I have a worksheet with stock charts.
Under each chart is a cell I use to enter the current price of the stock (I call it a quote). When it is entered, then I have some messages show up on the chart displaying the quote and drawing some lines. The message contain the date and time I entered the quote. Unfortunately when I go to the next chart and enter a quote there, the time in message of the first quote changes because I do all this with formulas.
So what I need is to sensitize the cells that I use to enter the quotes (a la Change_Value event I suppose) so that the one used will call a macro that does the time stamping. I was hoping to make it all formula driven, but maybe I can't.
Thanks for the response.

mdmackillop
03-13-2006, 01:16 PM
Hi Sid,
Try a UDF to show the time =DoNow(). If it has no references, it shouldn't update unless forced to (Ctrl +Alt +F9)

Function DoNow()
DoNow = Format(Now(), "HH:MM:SS")
End Function

Cyberdude
03-14-2006, 03:59 PM
Thanks, Malcolm. Looks interesting ... I'll give it a try. :bow: