Rank top 4 scores and assign points (Or Equals)

ctild

New Member
Joined
Jan 26, 2008
Messages
44
I not used to using VB very much so I'm looking for help with a points awarding code for a scoring system. I've looked for similar codes that I might be able to amend, but haven’t managed to find what I need.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I have a list of scores in column B starting at row 5 ("B5"). <o:p></o:p>
The list may contain blanks for a non return, but will also be variable depending on the number of attendees, so it will need to find the bottom row. <o:p></o:p>
<o:p></o:p>
Application.Goto Cells(Rows.Count, "B").End(xlUp)<o:p></o:p>
Range(Selection, Range("B5")).Select<o:p></o:p>
<o:p></o:p>
What I need is a way to assign points to the top 4 scores "or equal" and paste the points awarded into column H starting at row 5 ("H5").<o:p></o:p>
<o:p></o:p>
e.g. <o:p></o:p>
The top score gets 5 points. <o:p></o:p>
If two scores are equal 2nd they both get 4 points.<o:p></o:p>
The 3rd highest score gets 3 points.<o:p></o:p>
If two scores are equal 4th they both get 2 points. <o:p></o:p>
<o:p></o:p>
Basically don't just allocate the points to the top 5 scores only.<o:p></o:p>
<o:p></o:p>
If possible, I would also like to allocate a default point of "1", for all other entries found in Column B, that wasn't awarded a point as above. (i.e. You get 1pt for turning up)<o:p></o:p>
<o:p></o:p><o:p></o:p>
I realise this might be a little complicated but any help to a Newbie appreciated.<o:p></o:p>
<o:p></o:p>
 
This is really annoying; I’ve spent a couple of days on this now.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I had the code working fine, but then I needed to re-design the worksheet and introduce my Add or Delete a player code. Unfortunately I might not be the only person using this file so I’m trying to automate this as much as possible for those will less PC skills.<o:p></o:p>
<o:p> </o:p>
At present if I want to add a player, I’m finding all cells from ("B10") down to the last cell with a value in Column AK, - then moving them down 1 Row. I then copy some formatted ‘donor cells’ and insert them back in at the top of the range, ("B10:AK10") - enter the new players name in ("B10”) & ("AL10”) using a Userform. Then I use an Ascending "Sort", based on the Players first Name in column B within the Range ("B10:AK60") - putting them back in alphabetical order.<o:p></o:p>
<o:p> </o:p>
The problem is, after the inserting the new Player name and doing a “Sort”, the associated Formulas loose their original references and don't work as before. <o:p></o:p>
<o:p> </o:p>
So what I think I need now is a way of re-inserting the correct formulas using VBA to replace all the Formulas after either inserting a new row, or deleting at row when a player leaves. <o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
(I'm assuming that 60 will be the Max number of members required)<o:p></o:p>
<o:p> </o:p>
How I’ve set it up:-<o:p></o:p>
I use column “AJ” for all the player’s names, starting at (“AJ10:AJ60”) downward. The player’s scores are then inputted into the cell adjacent to their name (“AK10:AK60”) using another Userform. The formula for awarding points to the top 4 scores also starts adjacent, at (“AL10:AK60”). Finally the Top 4 Scores also starts adjacent at (“AM10:AM13”).<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Any further help appreciated.<o:p></o:p>
<o:p> </o:p>
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This is really annoying; I’ve spent a couple of days on this now.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I had the code working fine, but then I needed to re-design the worksheet and introduce my Add or Delete a player code. Unfortunately I might not be the only person using this file so I’m trying to automate this as much as possible for those will less PC skills.<o:p></o:p>
<o:p></o:p>
At present if I want to add a player, I’m finding all cells from ("B10") down to the last cell with a value in Column AK, - then moving them down 1 Row. I then copy some formatted ‘donor cells’ and insert them back in at the top of the range, ("B10:AK10") - enter the new players name in ("B10”) & ("AL10”) using a Userform. Then I use an Ascending "Sort", based on the Players first Name in column B within the Range ("B10:AK60") - putting them back in alphabetical order.<o:p></o:p>
<o:p></o:p>
The problem is, after the inserting the new Player name and doing a “Sort”, the associated Formulas loose their original references and don't work as before. <o:p></o:p>
<o:p></o:p>
So what I think I need now is a way of re-inserting the correct formulas using VBA to replace all the Formulas after either inserting a new row, or deleting at row when a player leaves. <o:p></o:p>
<o:p></o:p>
<o:p></o:p>
(I'm assuming that 60 will be the Max number of members required)<o:p></o:p>
<o:p></o:p>
How I’ve set it up:-<o:p></o:p>
I use column “AJ” for all the player’s names, starting at (“AJ10:AJ60”) downward. The player’s scores are then inputted into the cell adjacent to their name (“AK10:AK60”) using another Userform. The formula for awarding points to the top 4 scores also starts adjacent, at (“AL10:AK60”). Finally the Top 4 Scores also starts adjacent at (“AM10:AM13”).<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Any further help appreciated.<o:p></o:p>
<o:p></o:p>
I'm not much of a programmer so I won't be of much help with this.
 
Upvote 0
Finally sorted it.
I wasn't asking for the Vb codes to insert the new player, just how to insert the modified Formulas in the correct positions.

I just kept coming up with errors, which may have been my problem not understanding how the formula worked.

But finally managed to Record the correctly referenced Array formulas correctly.

Selection.FormulaArray = _
"Modified code here"


Thanks again for all your time & assistance.
 
Upvote 0
Finally sorted it.
I wasn't asking for the Vb codes to insert the new player, just how to insert the modified Formulas in the correct positions.

I just kept coming up with errors, which may have been my problem not understanding how the formula worked.

But finally managed to Record the correctly referenced Array formulas correctly.

Selection.FormulaArray = _
"Modified code here"


Thanks again for all your time & assistance.
Good deal. Thanks for feeding back! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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