Forum Discussion

Celia Calo's avatar
Celia Calo
Copper Contributor
Dec 03, 2017

sorting date column oldest to newest

I imported a csv file of my connections from linkedin and I want to sort them by the date we connected.

Even though I mark the whole column (F) to be a date column, so they become date cells (aligned to the right and sort-able newest-to-old) some don't and remain aligned to the left and sort is only a-z,

Any help would be much appreciated, I've been trying for days!!!

16 Replies

  • kadirguler's avatar
    kadirguler
    Brass Contributor

    Hi,

    It's been a while since the topic, but the solution that I created may be useful for those who cannot solve the problem.

     

    Dates in a column can be sorted easily from oldest to newest in other column by getting records from Adodb.Recordset :

    rs.Open sorgu, con, 1, 1
    
    Range("K3").CopyFromRecordset rs

     

     

    https://eksi30.com/vba-filter-between-two-dates-with-userform/

    • KeepItS1mple's avatar
      KeepItS1mple
      Copper Contributor
      I have a much simpler solution. I still couldn't get option of 'newest to oldest' to appear in Sort, after following steps above to use 'Text to Column' on data tab, and setting number format in column to date dd/mm/yyyy.
      So instead I changed date format to yyyy-mm-dd and then I could use 'sort ascending' in the sort function to get my dates from newest to oldest.
  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    This problem is common!

     

    These dates that you think them are dates are not dates!

    They are texts!

     

    Please provide us with a sample of these text dates, to figure out how to parse them!

      • Melanie Tomitsch's avatar
        Melanie Tomitsch
        Copper Contributor

        Text to columns on the Data tab usually fixes that, just select date.

         

        Also, if you've taken data out of MS Project. The date name "Tue" "Wed" etc is imported. It will fix it to actual dates by doing a find | replace "??? "

Resources