+ Reply to Thread
Results 1 to 2 of 2

VBA to make the date and time continue to update

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2014
    Location
    america
    MS-Off Ver
    2013
    Posts
    12

    VBA to make the date and time continue to update

    Hi,
    I have a label that displays the date using the = now code

    Me.lblDateIns = Now
    When I open the form the date and time is correct, but it doesn't update while the form is open. Is there a way to make the date and time always correct while the form is open.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to make the date and time continue to update

    hmm,

    This code runs the macro TextTime every second.
    TextTime writes the time into Label1.

    Sub Macro1()
    
    Application.OnTime Now + TimeValue("00:00:01"), "TextTime"
    UserForm1.Show
    
    End Sub
    
    Sub TextTime()
    UserForm1.Controls("Label1").Value = Now
    Application.OnTime Now + TimeValue("00:00:01"), "TextTime"
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Click to make another 100 rows - continue formula down too
    By domgilberto in forum Excel General
    Replies: 2
    Last Post: 05-20-2014, 05:58 AM
  2. [SOLVED] help on vba code to make list continue column and change date format
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2013, 12:06 PM
  3. [SOLVED] Update Links = 1, Auto-Continue
    By gord.lawson11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-27-2011, 04:10 PM
  4. VBA Code to continue in Update Links error message
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 03:53 PM
  5. Last Update Date and Time
    By abhishekbt in forum Excel General
    Replies: 5
    Last Post: 07-02-2009, 03:51 AM

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