+ Reply to Thread
Results 1 to 3 of 3

Macro mess with the date formatting

  1. #1
    Registered User
    Join Date
    06-24-2012
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    15

    Macro mess with the date formatting

    I'm working on my team metrics. I receive a bunch of incidents with the corresponding dates and times in the US format (mm/dd/yyyy HH:MM:SS)
    For some reason, when I move the data from the cvs file to the xls I work, it modify all dates over the 13th.
    I have been working this manually to get mm/dd/yyyy. But when I tried to move the manual steps to a macro it mess the formatting again

    Please Login or Register  to view this content.
    Basically the script do the same I do manually:
    - Copy the dates to an aux column
    - Using Text to columns, remove the time
    - Change the format to text
    - Use the formula to get the dates
    - Clean the format from the destination
    - Change the format to get mm/dd/yyyy
    - Copy the data
    - Remove the aux columns


    I don't know VBA language to script the macro, so I used the auto recording from excel.

    I have attached a test spreadsheet I have using.
    test formats.xlsx

    Any help will be appreciate

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Macro mess with the date formatting

    Not sure if I understand your issue properly but why don't you change this line and get it into dd/mm/yy format

    Please Login or Register  to view this content.
    to this

    Please Login or Register  to view this content.
    and while you're at it teh macro is trying to use column B in the first line I had to chnage that to A2 to A106 to get it to work
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    06-24-2012
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro mess with the date formatting

    That won't work, because not all the dates are in dd/mm/yyyy.
    Only the dates after the 13th are in that format.

    I know the macro is using the column B. I attached a test spreadsheet to see the different dates I'm using.

+ 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. Formula Mess
    By erikapalen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2014, 02:48 PM
  2. [SOLVED] Dates in both date and text format mess up autofilter and sumifs in VBA
    By Maxdehaas in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2014, 12:01 PM
  3. Macro - Formatting date from mm/dd/yy to dd/mm/yy
    By Klara86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2012, 03:53 PM
  4. Date Formatting in a Macro
    By gregersanderson@gmail.com in forum Excel General
    Replies: 3
    Last Post: 05-18-2006, 09:15 PM
  5. [SOLVED] Crl-Ed : another way to mess-up and fix
    By Patricia Shannon in forum Excel General
    Replies: 0
    Last Post: 03-23-2006, 02:45 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