+ Reply to Thread
Results 1 to 12 of 12

format of date after array resort - one date refuses to play ball

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    format of date after array resort - one date refuses to play ball

    Hi
    The following code lifts data from a sheet and via an array resorts copies it back the same sheet. The date is in the correct format "11/07/19" before macro is run

    Please Login or Register  to view this content.
    The dates are returned to column 3 and even though the column is formatted to date and the code specifies the date format our friend above resolutely returns as "07/11/19"

    No other dates seem affected

    Any ideas
    Last edited by nigelog; 07-31-2019 at 09:35 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,984

    Re: format of date after array resort - one date refuses to play ball

    Is the date in question really a date, or text?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: format of date after array resort - one date refuses to play ball

    Try this ...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: format of date after array resort - one date refuses to play ball

    @ Ali .. yes export data comes in as a date

    @ sintek .. no go...

    Ill upload the workbook. Macro is stalled after array sort

    copy sheet1 to use export data again as deleted by macro
    Attached Files Attached Files

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: format of date after array resort - one date refuses to play ball

    The date is in the correct format "11/07/19" before macro is run
    what range is this troublesome date

    Edit...Also, when you make use of With statement always ensure that the point is added to reflect correct
    Please Login or Register  to view this content.
    Last edited by sintek; 07-31-2019 at 07:17 AM.

  6. #6
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: format of date after array resort - one date refuses to play ball

    Hi Sintek

    date is highlighted in yellow "E7" sheet(1)

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: format of date after array resort - one date refuses to play ball

    Tricky little bugger...
    I just re-coded a snippet...this works...
    Please Login or Register  to view this content.
    Incorporate into your code...
    Last edited by sintek; 07-31-2019 at 09:24 AM.

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: format of date after array resort - one date refuses to play ball

    Hi Sintek

    was just giving up on it when you posted

    Good shot ....that nailed him

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: format of date after array resort - one date refuses to play ball

    ...........................................
    Thanks.gif

  10. #10
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,916

    Re: format of date after array resort - one date refuses to play ball

    FWIW, you should also be able to simply amend the original code to read:

    Please Login or Register  to view this content.
    Rory

  11. #11
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: format of date after array resort - one date refuses to play ball

    I forgot all about its use Rory.. would have saved so much time. Thanks for the pointer Rory

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: format of date after array resort - one date refuses to play ball

    Same here lol...

+ 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. Formatting a date that refuses to change
    By learn4life in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2019, 04:42 PM
  2. [SOLVED] Array to range with date format
    By jaryszek in forum Excel General
    Replies: 8
    Last Post: 11-28-2017, 04:18 AM
  3. Array to range with date format
    By jaryszek in forum Excel General
    Replies: 1
    Last Post: 11-28-2017, 03:49 AM
  4. [SOLVED] Function to resort selected entries in table by date
    By leovfx in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2017, 03:52 AM
  5. Replies: 2
    Last Post: 04-26-2017, 08:06 AM
  6. When transposing an array the date format changes
    By sungsam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2011, 11:47 AM
  7. Excel REFUSES to Listen to me regarding Date formatting
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2008, 10:28 AM

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