View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
T Lavedas T Lavedas is offline
external usenet poster
 
Posts: 38
Default Month:Date:Time:Seconds

On May 6, 2:04 pm, Ranjit kurian
wrote:
In my excel workbook the sheet1 is my Dashboard and sheet2, sheet3, etc...
are graphs , pivots etc...

Actually i need my Sheet1 Dashboard to display Month:Date:Time:Seconds in a
cell, so that whenever i open it should view me and the seconds should be
moving(running)just like a watch....


Maybe something like this ...

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)

Sub Workbook_WindowActivate(ByVal Wn As Excel.Window)
With ActiveWorkbook.Sheets(1)
Do
.Range("A1").Value = Now()
DoEvents
Sleep 250
Loop
End Sub

Save the macro in the code section of ThisWorkbook object, maybe.
Format the Sheet 1, A1 cell to display seconds.

The one drawback is that macros security will need to be set at least
to Medium, which will require confirmation to enable every time the
workbook is opened. Or the macro will require a signature of a
trusted source (and I have never done that).

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/