+ Reply to Thread
Results 1 to 3 of 3

Running Clock VBA has date as 1900-01-00 need to be today.

  1. #1
    Registered User
    Join Date
    12-30-2019
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    10

    Running Clock VBA has date as 1900-01-00 need to be today.

    I have this VBA macro to keep a contiuous clock running...

    Please Login or Register  to view this content.
    I need the date to be current as well as the time, currently it shows 1900-01-00, for the rest of the spreadsheet to work as it relies on a start date and time and the race finishes 24hrs later.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,810

    Re: Running Clock VBA has date as 1900-01-00 need to be today.

    There are three VBA functions -- Time which returns the current time of day (without date information).
    Date which returns the current day without time of day information.
    Now which returns both date and time information.

    I would replace your use of Time with Now in the statement that writes the current date/time to D2. The other thing I would do is write the data to Excel as a double rather than a text string to avoid any mistakes Excel might make in interpreting date/time text strings. Instead of Format(), I would use CDbl()
    Please Login or Register  to view this content.
    Does that work better?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-30-2019
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    10

    Re: Running Clock VBA has date as 1900-01-00 need to be today.

    This appears to be working, thank you very much!

+ 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. [SOLVED] Possible to generate Next Date when a running sum of Today()-30 drops below a set value?
    By Derwood726 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-07-2020, 10:22 PM
  2. Replies: 5
    Last Post: 02-10-2016, 07:20 PM
  3. date pasted as 1/2/1900 in excel instead of 1/1/1900
    By ekkslatha in forum Excel General
    Replies: 4
    Last Post: 10-25-2014, 08:34 PM
  4. Running Clock
    By Pradeep_7777 in forum Excel General
    Replies: 2
    Last Post: 07-17-2014, 08:16 AM
  5. Macro for changing the date from 02-Jan-1900 to 01-Jan-1900
    By Lavanya Anandan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2013, 07:08 AM
  6. TODAY() function + clock
    By Supergoku in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2008, 08:47 AM
  7. How do I subtract today's date from one before 1900?
    By Bob Martin in forum Excel General
    Replies: 3
    Last Post: 10-12-2005, 08:05 PM

Tags for this Thread

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