+ Reply to Thread
Results 1 to 6 of 6

Excel Changing Date Formats on its own

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2016
    Posts
    48

    Excel Changing Date Formats on its own

    Hi folks, I do hope you can help

    Cell T38 in my worksheet has a formula as follows:

    {=TEXT(MIN(IF('Amendments Data'!N:N="Future Tasks",'Amendments Data'!H:H)),"dd/mm/yyyy")}

    It correctly calculates the date I need.

    As part of some VBA a new sheet is created, this cell is copied, then pasted 'Values only' into the same cell on another sheet.

    If the date is eg. 15/11/2018 then it correctly inputs the date in the new sheet.

    However if the date is 01-12/11/2018 then it changes the date to show 11/01-12/2018.

    I cant fo rthe life of me figure out why. Anyone got an idea?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,462

    Re: Excel Changing Date Formats on its own

    Well, 01-12/11/2018 is NOT a date so it doesn't really matter how you format it.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2016
    Posts
    48

    Re: Excel Changing Date Formats on its own

    I was making the point that any number between 01-12 it changes the format, any number over that - it doesn't.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,462

    Re: Excel Changing Date Formats on its own

    Ah, ok. Then that's because VBA treats dates with the American Format of month day year. And, of course, a day 12 or less can be confused with a month.

  5. #5
    Registered User
    Join Date
    10-09-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2016
    Posts
    48

    Re: Excel Changing Date Formats on its own

    Thanks, so is it just a simple addition of specific format to the way VBA pastes it in then?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,462

    Re: Excel Changing Date Formats on its own

    Maybe get and save the date value rather than the date text. Then paste the date value and post as required.

+ 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] Changing Date Formats
    By hammer2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-06-2015, 01:59 AM
  2. [SOLVED] Date formats not changing
    By Glenn Kennedy in forum Excel General
    Replies: 7
    Last Post: 12-14-2012, 07:26 AM
  3. changing some date formats
    By bluize in forum Excel General
    Replies: 2
    Last Post: 06-18-2008, 03:13 PM
  4. Changing date time formats in EXCEL
    By gordo29 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-30-2008, 03:21 PM
  5. Changing date formats?
    By lakegoddess in forum Excel General
    Replies: 5
    Last Post: 01-06-2006, 01:26 PM
  6. Changing date formats in Excel
    By fdoherty in forum Excel General
    Replies: 1
    Last Post: 07-12-2005, 10:05 AM
  7. [SOLVED] Excel 2003 is changing my date formats
    By nbalch in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-26-2005, 03:06 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