Results 1 to 2 of 2
  1. #1

    Displaying Real Time in Excel

    Hi Folks

    OK firstly I'm not an excel expert so gently please. What I'd like to do is to display a real time clock in a Excel (97) cell an be able to carry out simple calculations using the time which would update data accordingly. I realise this could be processor intensive so I'd like to be able to change the "sensitivity" so that time changed every say 30 secs.

    Is this easily achieved can I link to the Windows clock via DDE ?

    Any help much apprecated......



  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    South Carolina, USA
    Thanked 0 Times in 0 Posts

    Re: Displaying Real Time in Excel

    You can do this by writing a VBA routines similar to the following:

    <pre>Public Sub UpdateClock()
    Sheet1.Range("A1") = Format(Time(), "h:mm:ss")
    Application.OnTime Now() + TimeValue("00:00:30"), "UpdateClock"
    End Sub

    Once started, that routine will update a time display in A1 on Sheet1 every 30 seconds. If you want the clock to start automatically when the workbook is opened, then you can call this routine in the WorkbookOpen event routine.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts