How to sort rows by column A "Jun 10 2011" or "Mar 01 2010"

buckwheat4948

New Member
Joined
Jun 10, 2011
Messages
14
How do I sort the rows 11 to 65535 by the data in Column A that has the format "Jun 10 2011" or "Mar 01 2010" or "Apr 20 2011" from oldest on top to newest on bottom.

I currently use the following, but it sorts by first letter putting 'Jun 10 2011 before "Mar 10 2010":

Dim StRw As Integer, EndRw As Integer
For i = 1 To ThisWorkbook.Sheets.Count
Set NewSheet = ThisWorkbook.Sheets(i)
NewSheet.Activate
With NewSheet
StRw = 11 ' Starting Row
EndRw = Range("E65500").End(xlUp).Row
Rows(StRw & ":" & EndRw).Select
Selection.Sort Key1:=Range("A11"), Order1:=xlAscending
End With
Next i

Thanks!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to the board..

It sounds like your dates are not really dates, just text strings that look like dates...

Do you want to keep the dates as text, or would you want a permanent conversion to real dates?
If you convert them to real dates, they will sort normally as you expect them to.
 
Upvote 0
Best option I think would be to create an additional column that represents a real date based on the string in column A, then sort on that column..

Say your dates are in column A
And you have an available column B

Highlight column A
Click Data - Text To Columns
Choose Deliminated
Click Next
Uncheck all boxes
Click Next
Choose Date - MDY

IMPORTANT - to keep existing data as is..
IN the Destination box, choose an available column, say B1

Click Finish.

You now have a new column with the same dates, but they are real dates and will sort as you expect them to.


Hope that helps.
 
Upvote 0
Maybe ill try to change the format to a real date format.

Thanks for you help. I'll see how it goes and repost if i have a problem.
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top