Results 1 to 14 of 14

VBA solution to convert mixed UK/US date formats

Threaded View

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2016, 365
    Posts
    7

    Question VBA solution to convert mixed UK/US date formats

    Hi All

    I have a macro to import data from a .csv file that contains dates in DD/MM/YYYY format - which is the format I need.

    At some point in the process, some of the dates are converted to MM/DD/YYYY.

    I am using Excel 2016 and I think I have a solution using "Text to Columns" but when I record it as a macro, the step that involves formatting the column data as MDY does not appear to get recorded.

    How would I write this into the code? (Assuming this is the right way to do it)

    Columns("C:C").Select
        Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
            :=Array(1, 3), TrailingMinusNumbers:=True
        Range("A1").Select
    Thanks in advance
    Last edited by Pepe Le Mokko; 01-24-2020 at 07:23 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert date formats
    By asad.ermo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2018, 09:25 AM
  2. Replies: 19
    Last Post: 01-31-2016, 12:29 PM
  3. [SOLVED] mixed date formats in s/s, how to format
    By cal_chica in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-16-2014, 06:22 PM
  4. Excel file has mixed date formats
    By pushnoyj in forum Excel General
    Replies: 1
    Last Post: 02-14-2014, 07:45 PM
  5. Mixed US and UK date formats in Excel Spreadsheet
    By Buntrock in forum Excel General
    Replies: 15
    Last Post: 11-07-2012, 10:58 AM
  6. Replies: 4
    Last Post: 08-25-2012, 07:49 AM
  7. Convert date formats mmm-yy to dd-mm-yy
    By acjarus in forum Excel General
    Replies: 10
    Last Post: 05-29-2012, 10:53 AM

Tags for this Thread

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