Thread: Refesh time
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Lorri Lorri is offline
external usenet poster
 
Posts: 9
Default Refesh time

Thanks Bob- I am having issues though - How do I get this to run? I can input
it fine but it is not updating anything. I follow the instructions you gave
me and then just X out of the screen to go back to the file, but then what?
Am I missing something?

"Bob Phillips" wrote:

Yeah, add a workbook open procedure


Private Sub Workbook_Open()
ShowTime
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Lorri" wrote in message
...
So there is no way to have the file up - like a schedule and have it

update
the time every minute to do a conditional format?

I apprecaite the feedback

"Bob Phillips" wrote:

Not quite, you will need to launch it, ToolsMacroMacros..., select
ShowTime and run it.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Lorri" wrote in message
...
Thanks - So I just enter this in - go back to the file and it should
automatically refresh the file every minute to update the time while I
have
the file open?

"Bob Phillips" wrote:

Add this procedures

Public nTime as double

Public Sub ShowTime()
Worksheets("Sheet1").Range("A1").Value = Format(Time,

"hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "ShowTime"
End Sub

and run it.

You need to stop it also

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime ntime, "ShowTime", , False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Lorri" wrote in message
...
Is there anyway to have an excel file up and have it automatically
refresh
the file so that the time gets updated every minute?
Thanks
Lorri