+ Reply to Thread
Results 1 to 3 of 3

Converting date from various forms to mm/dd/yyyy format

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Converting date from various forms to mm/dd/yyyy format

    Hi, guys, I am trying to convert the data in a column, "N" which is an output of another macro into mm/dd/yyyy format.

    Below are the steps I am trying to perform:

    1. Cell will have data in the format: 'some special characters' <space> 'Date' <space> 'timestamp or some string'
    2. I have to get the 'Date' thats in the middle and convert it into "mm/dd/yyyy" format.
    3. Input Dates can be of the below formats;
    dd/mm/yyyy
    dd/mm/yy or mm/dd/yy
    d/m/yy or m/d/yy
    And finally similar dates but instead of '/' we might have "-" or "."

    I had written a macro which is as below:
    I had taken string length instead of truncating with <space> which gave me errors.
    For example:




    Input Date Output Date
    1/7/10 1/7/2010
    1/7/2010 1/7/2010
    1/7/2010 1/7/2010
    1/7/2010 1/7/2010
    20/07/11 11/15/42
    Upda 07/20/11 1
    1/7/2010 1/7/2010
    1/7/2010 1/7/2010
    1/7/2010 1/7/2010
    7/12/2010 12/7/2010
    7/12/2010 12/7/2010

    Suggestions please.
    Last edited by Sud; 03-20-2012 at 11:40 PM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Converting date from various forms to mm/dd/yyyy format

    You will have to follow the Forum Rules first. Edit your Post and place your code within "Quote Tags".

    You do not want to upset the Forum Moderators!
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Converting date from various forms to mm/dd/yyyy format

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for 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