Forum Discussion
Help with date sorting macro
- Jul 08, 2020
stephanieporter Please check the following video and following excel whether I understood correctly what you wanted to say.
And still if you have any query in VBA then you can also message me privately or on my mail id
And if you liked my answer please do mark my answer as best answer officially
stephanieporter Hey I have created a simpler Macro you can try this Macro
Sub Macro2()
'
' Macro2 Macro
'
'
Sheets("Sheet1").Select
Cells.Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Add Key:=Range _
("A1:A1048576"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
Selection.AutoFilter
End Sub
I am also attaching the file you can check whether it is running
Thank you! DevendraJain
If I have another Macro on the worksheet, do I just copy and paste this underneath it in the coding section?