ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort on C not A (https://www.excelbanter.com/excel-programming/409050-sort-c-not.html)

Helmut

Sort on C not A
 
I have the following:

ActiveSheet.Range("Employees").Sort _
Key1:=Range("A1", "Employees"), _
Order1:=xlAscending, _
DataOption1:=xlSortNormal, _
Header:=xlNo

This sorts Range: "Employees" by column "A"
What do I have to change to get the range sorted by column "C" ??

Charlie

Sort on C not A
 
ActiveSheet.Range("Employees").Sort _
Key1:=Columns("C"), _
Order1:=xlAscending, _
DataOption1:=xlSortNormal, _
Header:=xlNo



"Helmut" wrote:

I have the following:

ActiveSheet.Range("Employees").Sort _
Key1:=Range("A1", "Employees"), _
Order1:=xlAscending, _
DataOption1:=xlSortNormal, _
Header:=xlNo

This sorts Range: "Employees" by column "A"
What do I have to change to get the range sorted by column "C" ??



All times are GMT +1. The time now is 12:30 PM.

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