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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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