+ Reply to Thread
Results 1 to 5 of 5

Entering text, convert to date

  1. #1
    Registered User
    Join Date
    12-14-2006
    Posts
    10

    Entering text, convert to date

    Hello,

    I've searched the forums, and I've found some good tricks and tips, but I didn't seem to find the exact answer I was looking for.

    I have a simple spreadsheet where users enter data. Name of company, address, and then a date at the end.

    For the date column, to try and speed things up, I am trying to develop a function that will convert a date entered with no slashes into a proper date format.

    Example;

    User types 03122007, Excel automatically formats that to 03/12/2007. I would rather not parse the text and add a slash after the 2nd value, and another slash after the 4th value. I would like this to be an actual date format that Excel (or even Access) would recognize.

    This could either be an automatic format within that cell, or could use another "helper" column to format it.

    Thanks in advance for any help or suggestions.

  2. #2
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by polishmf
    Hello,

    I've searched the forums, and I've found some good tricks and tips, but I didn't seem to find the exact answer I was looking for.

    I have a simple spreadsheet where users enter data. Name of company, address, and then a date at the end.

    For the date column, to try and speed things up, I am trying to develop a function that will convert a date entered with no slashes into a proper date format.

    Example;

    User types 03122007, Excel automatically formats that to 03/12/2007. I would rather not parse the text and add a slash after the 2nd value, and another slash after the 4th value. I would like this to be an actual date format that Excel (or even Access) would recognize.

    This could either be an automatic format within that cell, or could use another "helper" column to format it.

    Thanks in advance for any help or suggestions.
    Hi
    you can use helper column at the end of date column.
    suppose you enter date in column C then put this function in col D
    =IF(C1<>"",LEFT(C1,2)&"/"&MID(C1,3,2)&"/"&RIGHT(C1,4),"") and copy down.
    when you would have entered all dates in column C then copy column D and paste special as values on column C. (i-e overwrite column C)
    hope this would help you.

  3. #3
    Registered User
    Join Date
    12-14-2006
    Posts
    10
    Thanks starguy. That may work.

    Is there anyway to format the cell itself to accept an entry of 8 digits and convert it to a date?

    Example;

    In B1, 03122007 is entered, and the user hits tab to move to the next field. B1 is then automatically formatted to 03/12/2007.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Take a look at this link

    http://www.cpearson.com/excel/DateTimeEntry.htm


    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    12-14-2006
    Posts
    10
    Excellent link! Thank you!

+ 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