Ranking by percentage

B

Blade370

How can you rank by percentage alone? I have a table of players stats that
are rated using percentages and i would like to have the table automatically
rank them desceding as the sheet is updated.
 
G

Gary''s Student

Here is a very simple example. The player's names are in column A and the
percentages are in column B. Enter this macro in Worksheet code:


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("B:B"), Target) Is Nothing Then
Exit Sub
End If
Application.EnableEvents = False
Set r = Range("A:B")
r.Sort Key1:=Range("B1"), Order1:=xlDescending
Application.EnableEvents = True
End Sub

Anytime you change a percentage in column B, the list will re-sort itself in
descending order. It's automatic and requires no formulas at all.


REMEMBER: Worksheet code.
 
Top