VBA code for autosorting ranked row

smartcookie3

New Member
Joined
Dec 5, 2017
Messages
1
Good morning! I am working on a project for the president of our company and am not familiar with VBA code, as I have not had cause to use it until now.

I have an excel spreadsheet with 8 participant names, participating in 7 events. Each participant's total of the 7 events is calculated and than ranked. However, he would like the spreadsheet to autosort the rank as scores from each round are entered. I have tried various VBA code lines, but have not had any success. Your input is greatly appreciated!

My data appears as follows:

[TABLE="width: 700"]
<colgroup><col width="89" style="width: 67pt; mso-width-source: userset; mso-width-alt: 3254;"> <col width="26" style="width: 20pt; mso-width-source: userset; mso-width-alt: 950;"> <col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;"> <col width="89" style="width: 67pt; mso-width-source: userset; mso-width-alt: 3254;" span="8"> <tbody>[TR]
[TD="class: xl66, width: 89, bgcolor: #FEFCFA"]Rank[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Player[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 1[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 2[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 3[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 4[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 5[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 6[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Round 7[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]Total[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]John Doe[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]12[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]9[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]9[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]12[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]54[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Bob Smith[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]2[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]4[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]32[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Tom Jones[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]2[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]4[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]7[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]16[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]47[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]4[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Gary Webster[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]7[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]34[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]2[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Bill Brown[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]10[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]9[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]7[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]49[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]7[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]James White[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]7[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]2[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]30[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Mark Black[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]2[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]4[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]6[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]5[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]33[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="width: 26, bgcolor: #FEFCFA"] [/TD]
[TD="width: 103, bgcolor: #FEFCFA"]Scott Green[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]3[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]4[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]1[/TD]
[TD="width: 89, bgcolor: #FEFCFA"]8[/TD]
[TD="class: xl63, width: 89, bgcolor: #FEFCFA"]26[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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