+ Reply to Thread
Results 1 to 9 of 9

datetime.now function not working properly upon entering into spreadsheet.

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    datetime.now function not working properly upon entering into spreadsheet.

    Hi.

    Im using a user form that automatically enters the date and time into a text box
    Please Login or Register  to view this content.
    I then use the information entered into the user form, and have it inputted onto a worksheet.

    I have the cells in which it is added to formatted under custom: mm/dd/yyyy h:mm

    on the user form, it shows the correct time and date, but once on the spread sheet, it changes the time to 12:00 am.

    any ideas as to what is happening?

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: datetime.now function not working properly upon entering into spreadsheet.

    how do you put the value back into the worksheet cell?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: datetime.now function not working properly upon entering into spreadsheet.

    using this subroutine:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: datetime.now function not working properly upon entering into spreadsheet.

    always use CDate when passing dates back to a cell
    Please Login or Register  to view this content.
    for instance

  5. #5
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: datetime.now function not working properly upon entering into spreadsheet.

    Okay, I will try that. What does Cdate do?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: datetime.now function not working properly upon entering into spreadsheet.

    it converts a text representation of a date/time value into a true date data type using your regional settings

  7. #7
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: datetime.now function not working properly upon entering into spreadsheet.

    It's still doing the same thing. :/

    It's occurring when I do this function:

    Located on the sheet 'Home Page'
    under the "Contractor" button. fill out form. and transfers to "Current Contractors" worksheet.

    I attached my workbook. Password is "MillSteel"

    perhaps this will help..
    Attached Files Attached Files

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: datetime.now function not working properly upon entering into spreadsheet.

    works fine for me as long as you enter a time (your today's date buttons don't do that)

  9. #9
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: datetime.now function not working properly upon entering into spreadsheet.

    oh........... I was looking at the ones that only enter as the mm/dd/yyyy. I just need to change the format of the cells.

    thanks so much!

+ 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