+ Reply to Thread
Results 1 to 7 of 7

Convert text to "mm/dd/yyyy hh:mm:ss" format

  1. #1
    Registered User
    Join Date
    05-13-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    90

    Convert text to "mm/dd/yyyy hh:mm:ss" format

    Is it possible to get a macro to convert the values on column D and E to "mm/dd/yyyy hh:mm:ss" format.

    Attached the workbook. Currently the values are shown as text and I was not able to change them any other way. Text to Columns will not work for me as it requires inserting new columns

    I tried at Excel General but didn't really find a solution that I can use for what I wahttp://www.excelforum.com/excel-gene...ates-time.html

    I think a code will be the best way to do it. Will appreciate any help.
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    This is a duplicated post

    http://www.excelforum.com/excel-gene...ates-time.html
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    Text-to-columns, the way you want to use it, does not require columns to be inserted.
    Using your posted workbook
    • Select D1:D5
    • Data.Text-to-columns
    ...Check: Delimited...Click: Next
    ...Leave: Tab checked...Click: Next
    ...Check: Date MDY
    ...Click: Finish
    • Repeat for E2:E5
    • Set the number format to Custom: mm/dd/yyyy hh:mm:ss

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    05-13-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    90

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    Doesn't work by using text to columns. I follow these steps and value remains as "text". This is the way this report is generated and I cannot change it unfortunately

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    I don't know what else to recommend. It works on the file you attached.

  6. #6
    Registered User
    Join Date
    05-13-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    90

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    It is strange because it working for some people and for some other computers. Maybe the problem is with my excel settings after I re-installed windows and office and the way excel reads dates

  7. #7
    Registered User
    Join Date
    05-13-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    90

    Re: Convert text to "mm/dd/yyyy hh:mm:ss" format

    I found the problem. It was my regional windows settings. Had to change the settings to English (United States). After that excel would read the dates as normal. Thanks

+ 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. Replies: 1
    Last Post: 12-11-2013, 10:35 AM
  2. [SOLVED] Convert from "general" (YYYYMMDD) to specific "custom" format (YYYY.MM.DD)
    By Ella_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 02:23 AM
  3. [SOLVED] convert general format to text format with "0" at beggining
    By grue in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2012, 12:39 PM
  4. convert string to date format of "d-mmm-yyyy"
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-12-2011, 09:48 AM
  5. Format Text Box as "dd/mm/yyyy"
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2009, 01:15 PM

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