ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorting Using Code (https://www.excelbanter.com/excel-programming/308340-sorting-using-code.html)

Jim May

Sorting Using Code
 
I have a data table A5:L3776 - Row 5 is header info
I need to enter code to sort this range
Primary Sort on B Column
Secondary Sort on G Column
The Macro recorder is screwing things up.
Can someone get me through this?
TIA,



Tom Ogilvy

Sorting Using Code
 
Range("A5:L3776").Sort Key1:=Range("B5"), _
Order1:=xlAscending, Key2:=Range("G5"), _
Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom



--
Regards,
Tom Ogilvy

"Jim May" wrote in message
news:FDrYc.22960$wu.18895@okepread04...
I have a data table A5:L3776 - Row 5 is header info
I need to enter code to sort this range
Primary Sort on B Column
Secondary Sort on G Column
The Macro recorder is screwing things up.
Can someone get me through this?
TIA,






All times are GMT +1. The time now is 01:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com