A soting problem

Glenn Masterson

New Member
Joined
Feb 17, 2005
Messages
49
Here is a macro that I recorded

ActiveCell.Offset(0, -2).Range("A1:C57").Select
ActiveCell.Activate
Selection.Sort Key1:=ActiveCell, Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=3, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

The problem that I have is that it sorts from left to right. I need it to sort
from right to left, can anyone help me.

Glenn
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
What I mean is it sorts by column A first, top to bottom keeping the info in the active range together, as in column A to column C, (left to right) What I need it to do is sort by Column C to A, (right to Left).

Hope this makes sense

Glenn
 
Upvote 0
I got three columns A,B & C, The information that gets put into the cells come from other pages in the workbook. Once I update the workbook each week I come to this page and sort it in descending order by highlighting the three columns and going into the data, sort, then I sort by column C.

A B C
team names weekly score total score
Gold Tops 54 526
Norfolk & Chance 41 472
Suffolk 'n' Good 9 431
Far Corfe 45 413
Delta Force 33 403
Stranner's Supremoes 27 402
Master Class 10 401
Doomed to Win 24 396
Guildies Elf 17 392
Inside the 25 19 382

The macro that I recorded sort by Column A. What I need is a macro that sorts by column C. It has to be active as I sort a different Table each week. All the tables are the same size.

Hope this makes better sense

Glenn
 
Upvote 0
Why don't you record a macro that sorts by column C then?

Given your existing code try:

Code:
Selection.Sort Key1:=ActiveCell.Offset(0, 2), Order1:=xlDescending, Header:=xlNo, _ 
OrderCustom:=3, MatchCase:=False, Orientation:=xlTopToBottom, _ 
DataOption1:=xlSortNormal
 
Upvote 0
sorting problem

Thank you Andrew that worked fine, feel like an idiot as that was so simple for you to sort out for me.

Glenn
 
Upvote 0

Forum statistics

Threads
1,207,171
Messages
6,076,916
Members
446,241
Latest member
Nhacai888b

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