+ Reply to Thread
Results 1 to 5 of 5

Date format issue

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Date format issue

    Hello all, I have some code which extracts data from the web and pastes into Excel.

    The date (column A) extracts to the format below 01.04.2014

    At this moment it is stored as just text. So I run a find and replace to change . to / - but when it does this - it makes the field a date, but it now reads 04/01/2014 rather than 01/04/2014.

    The find and replace works if the day is greater than 12 (as there are only 12 months I guess), but for days less than 13 it flips the day and the month the wrong way around.

    Can anyone provide some code to turn 01.04.2014 into 01/04/2014 (or 41730 - the date code for the date)

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Date format issue

    Hi,
    The Date function should help. See if
    =DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,4,2))
    works for you in the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Date format issue

    Try Date>Text to columns... selecting DMY for column data format on the 3rd step.
    If posting code please use code tags, see here.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Date format issue

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Date format issue

    Hi all and thanks for your replies. JOHN H DAVIS your Vba code suited my needs perfectly - thank you

+ 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] Issue with date format when comparing two date values (I'm in Australia)
    By aaron.irvine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 01:13 AM
  2. Date format issue
    By skhari in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2012, 02:08 AM
  3. [SOLVED] date format issue
    By Arjen in forum Excel General
    Replies: 3
    Last Post: 08-22-2006, 09:10 AM
  4. Date Format Issue
    By tgilbreath in forum Excel General
    Replies: 2
    Last Post: 06-08-2005, 11:05 AM
  5. Date Format Issue
    By Mikeice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2005, 06:54 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