+ Reply to Thread
Results 1 to 8 of 8

Macro to Update Leaderboard

  1. #1
    Registered User
    Join Date
    08-18-2013
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    65

    Macro to Update Leaderboard

    Hi

    I’m trying to create a ‘live’ Leaderboard for a quiz I want to do with my class.

    I’ve created the attached workbook which has two worksheets; Scoreboard and Leaderboard. I intend to Chromecast the Leaderboard only to the class and I’ll be able to see both the Scoreboard and Leaderboard on my computer.

    Scoreboard Worksheet:
    I’ve set up this worksheet for me to enter the data for each round of the quiz. I’ve entered 1s in various data cells to test the formulae. I will change the names of the teams (Team 1, Team 2 etc) to those provided by the students when I run the competition.
    I’ve entered a SUM formula in Column C to calculate the total from each round.
    I’ve entered a RANK formula in Column D to determine the rank of each team based on the total.

    Leaderboard Worksheet:
    I’ve created a Leaderboard that shows only the Team Name and Rank.
    First, second and third places get coloured Gold, Silver and Bronze by Conditional Formatting.

    What I need:
    I need a Macro attached to the Update Leaderboard button on the Scoreboard Worksheet.
    So, when I click the Update Leaderboard button, a Macro does two things:
    1. Updates the Rank for all teams on the Leaderboard worksheet from column D on the Scoreboard worksheet.
    2 Sort the teams on the Leaderboard worksheet by the Rank with the first placed team at the top.

    The reason why I want a Macro attached to the Update Leaderboard button, rather than the students seeing it automatically updated when I enter data into the Scoreboard worksheet, is to create suspense.
    I’ve tried to create a Macro to do this but have not been successful.

    Could someone please help me?
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Update Leaderboard

    Hi there,

    Take a look at the attached version of your workbook and see if it does what you need. It uses the following code:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your requirements.


    The ranking on the Leaderboard worksheet updates automatically because the following formula has been entered in Cell D4 and copied downwards:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-18-2013
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    65

    Re: Macro to Update Leaderboard

    Hi Greg M

    Thank you very much. Your macro works well.

    The only change I would request, if it's possible, would be to have the Leaderboard worksheet updated only when the 'Update Scoreboard' button is pushed.

    Regards

    Alan L 185

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Update Leaderboard

    Hi again,

    Many thanks for your feedback.

    The attached workbook uses the following code to ensure that the Leaderboard values are updated and sorted only when the "Update" button is pressed:

    Please Login or Register  to view this content.
    The highlighted values may be changed to suit your requirements.

    These values may need to be amended if the layout of the "Scoreboard" worksheet is ever changed.
    This value may need to be amended if the layout of the "Leaderboard" worksheet is ever changed.


    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files
    Last edited by Greg M; 09-04-2020 at 05:52 AM. Reason: Updated workbook attached

  5. #5
    Registered User
    Join Date
    08-18-2013
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    65

    Re: Macro to Update Leaderboard

    Hi Greg M

    Thanks for the updated version.

    Sorry for causing confusion.

    I need a Macro attached to the Update Leaderboard button on the Scoreboard Worksheet.
    So, when I click the Update Leaderboard button, a Macro does two things:
    1. Updates the Rank for all teams on the Leaderboard worksheet from column D on the Scoreboard worksheet.
    2 Sort the teams on the Leaderboard worksheet by the Rank with the first placed team at the top.

    Are you able to combined all the coding so that it updates the scoreboard and sorts it into rank order when the 'Update Scoreboard' button is clicked?

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Update Leaderboard

    Hi again Alan,

    Please excuse me!

    I posted the correct version of the VBA code but attached the wrong version of the workbook

    See if the attached version does what you need.

    Regards,

    Greg M
    Attached Files Attached Files
    Last edited by Greg M; 09-04-2020 at 05:54 AM. Reason: Updated workbook attached

  7. #7
    Registered User
    Join Date
    08-18-2013
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    65

    Re: Macro to Update Leaderboard

    Absolutely brilliant! Thank you so much for your help.

    All the very best to you.

    Alan L 185

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Update Leaderboard

    Hi again,

    Many thanks for your feedback.

    You're welcome - glad I was able to help.

    Regards,

    Greg M


    P. S. Many thanks also for the Reputation increase - much appreciated!
    Last edited by Greg M; 09-04-2020 at 04:07 AM. Reason: P. S. added

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Leaderboard
    By kirbster123 in forum Excel General
    Replies: 2
    Last Post: 12-12-2018, 02:37 AM
  2. Golf Leaderboard
    By plus4 in forum Excel General
    Replies: 4
    Last Post: 08-06-2014, 07:17 AM
  3. Making a leaderboard in excel
    By mmaher5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2012, 03:17 PM
  4. Macro to refresh a leaderboard
    By zacmac in forum Excel General
    Replies: 2
    Last Post: 02-09-2012, 01:16 AM
  5. Top 10 leaderboard
    By jlevs95 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2012, 03:05 PM
  6. Leaderboard
    By Augusta in forum Excel General
    Replies: 5
    Last Post: 12-28-2011, 10:01 AM
  7. Automatic Leaderboard
    By dfd0001 in forum Excel General
    Replies: 3
    Last Post: 12-15-2011, 02:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1