+ Reply to Thread
Results 1 to 4 of 4

Not sorting dates properly

Hybrid View

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Salt Lake City, UT
    MS-Off Ver
    2010
    Posts
    11

    Not sorting dates properly

    I am trying to sort a sheet changing in length by date however, there are dates from 2012 and 2014 showing up first and then it is sorted correctly.


        Sheets("DATA").Select
        Cells.Select
        Range("A:DI").Sort key1:=Range("G:G"), _
        order1:=xlDescending, Header:=xlYes

  2. #2
    Forum Contributor amartinez988's Avatar
    Join Date
    05-04-2015
    Location
    Miami
    MS-Off Ver
    Office 2010
    Posts
    183

    Re: Not sorting dates properly

    Can you post the workbook so we can see?

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Salt Lake City, UT
    MS-Off Ver
    2010
    Posts
    11

    Re: Not sorting dates properly

    I can not post the workbook at this time. But I have updated some code and it is still not working properly.

        Sheets("DATA").Select
        Cells.Select
        Range("A:DI").Sort DataOption1:=xlSortTextAsNumbers, key1:=Range("G:G"), _
        order1:=xlDescending, Header:=xlYes

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,926

    Re: Not sorting dates properly

    The usual first culprit for something like this is having "dates" that are actually text strings instead of real dates. The first thing I would check is if all of the dates in the column of interest are real dates or if they are text strings (the =ISTEXT() function can be useful in this task).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Pivot table not sorting properly
    By Dast in forum Excel Charting & Pivots
    Replies: 13
    Last Post: 06-10-2016, 06:43 PM
  2. [SOLVED] VBA Not Sorting Properly
    By phelbin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2015, 12:56 PM
  3. Sorting A-Z not working properly
    By AKM1 in forum Excel General
    Replies: 1
    Last Post: 09-03-2013, 10:29 AM
  4. Report not sorting properly
    By nzkazza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2012, 10:46 PM
  5. sorting is not properly done on folders
    By joe41 in forum Word Formatting & General
    Replies: 1
    Last Post: 03-20-2009, 07:40 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