Auto Refresh.....Come On Guru's...Can i do this


Posted by Roy on November 16, 2001 2:12 PM

I have a worksheet that uses the NOW function to subtract a set time from the current time. This lapse is then used to generate a production output. I have put a refresh button on the sheet which updates the current date/time cell by running the now function when it is pressed. Is there a way to get excel to continually update the cell with real time.

Any help greatly appreciated

Roy

Posted by Barrie Davidson on November 16, 2001 2:20 PM

Try inserting this in the worksheet's code:

Private Sub Worksheet_Activate()
Call Recalculate
End Sub

and then insert this code in a new module:

Public Sub Recalculate()
Calculate
Application.OnTime earliesttime:=Now + TimeValue("00:00:05"), _
procedure:="Recalculate"
End Sub


Does this help you out?
BarrieBarrie Davidson



Posted by Roy on November 16, 2001 2:31 PM

That works a treat Barry Thanks a lot

Roy