+ Reply to Thread
Results 1 to 4 of 4

Data Sort

  1. #1
    Registered User
    Join Date
    05-06-2008
    Posts
    14

    Data Sort

    I have a table with three columns

    Name, Country and score

    The name and score are entered by the user and the country selected from a set drop down list.

    Once all the data is entered, I would like is be able to set a macro or formula to display or highlight just the top two results for each country. I just can't figure it out - any help would be appreciated.

    Thanks
    Paul

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Data Sort

    Try this

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.

  3. #3
    Registered User
    Join Date
    05-06-2008
    Posts
    14

    Re: Data Sort

    Thanks - unfortunately I'm getting an error code -Run-time Error '9': subscriptout of range

    It seems to highlight the top two for afghanistan (first on list) but finishes with the error code.

    Thanks
    Paul
    Last edited by stealthtrooper; 02-13-2013 at 07:07 PM.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Data Sort

    Try this - the error might be caused by a country which has only one entry. If this doesn't work, please post some sample data

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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