+ Reply to Thread
Results 1 to 2 of 2

How to get time to update automatically and continuos

  1. #1
    Elaine
    Guest

    How to get time to update automatically and continuos

    I would like me excel worksheet to keep the current time running continously.

  2. #2
    Martin
    Guest

    RE: How to get time to update automatically and continuos

    The problem with "continuous" is that it will mean a macro continuously
    running so you wouldn't be able to do anything else in your worksheet (unlike
    computer games, only one process can happen at a time in Excel).

    Another solution would be to use a suitable "event" to trigger a macro to
    update the time. I would suggest the SelectionChange event, i.e. the time
    updates every time you move the worksheet cursor. It's tempting to just make
    the macro recalculate at this point but you could have loads of other
    formulas in the sheet which would then also recalculate, slowing things up
    considerably.

    I think the best solution (but would be interested to read others) is to
    simply replace the cell contents with the latest time. Paste the following
    into the class module of the sheet you're working in (double-click on the
    sheet name in the Project Explorer in VB Editor). I've put the time into A1
    but you could change Cells(1,1) if you wanted a different cell. To make it
    run as quickly as possible, I haven't included formatting in the macro so
    you'll need to give cell A1 the time format you want:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells(1, 1) = Time
    End Sub

    "Elaine" wrote:

    > I would like me excel worksheet to keep the current time running continously.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1