Ranking by percentage

G

Guest

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

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top