Help on Macro to Sort Date

Grepees

Board Regular
Joined
Apr 15, 2009
Messages
81
I need help with a marcro i have that sorts dates. I have been using this Macro for years now. I just moved this into another file and when i run it, it returns an error message (shown below the code). The only difference is that this file has multiple columns with dates and i want to sort by column N. Any help would be very much appreciated. Thanks.


Sub SortByDate()
With Sheets("Customer List")
With .Range("N3").CurrentRegion
.Sort Key1:=.Columns(14 - .Column + 1), Order1:=xlAscending, Header:=xlYes

End With
End With
End Sub


1719268207334.png
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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