+ Reply to Thread
Results 1 to 8 of 8

Get top 10 values from a summary sheet bases on 1 condition

  1. #1
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Get top 10 values from a summary sheet bases on 1 condition

    Hi

    I've created the attached and want to get the top 10 values from column E of the INPUT sheet when a different name is selected in the drop down list in D1 on the summary sheet. I also want the relevetnt house number, Street name and Pososte code to populate I want to do this using VBA. How would I do this.
    top%2h010(1).xlsm
    Please see attached.

    Any help much appreciated

    Rgds,

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Get top 10 values from a summary sheet bases on 1 condition

    What about a pivot table and why not a macro to refresh automatically!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Get top 10 values from a summary sheet bases on 1 condition

    I know you have this in the VBA forum, but this ARRAY formula, copied down and across, will also give you what you want...

    =INDEX(INPUT!B$2:B$185,MATCH(LARGE(IF(INPUT!$A$2:$A$185='Summary Sheet'!$D$1,INPUT!$E$2:$E$185,0),'Summary Sheet'!$A4),INPUT!$E$2:$E$185,0))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Get top 10 values from a summary sheet bases on 1 condition

    Here is a VBA solution option for you,

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: Get top 10 values from a summary sheet bases on 1 condition

    Thanks ALan I get an error "unable to get the text property of the range class when the macr reaches the below code


    cbox = w1.Range("D1").Text

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Get top 10 values from a summary sheet bases on 1 condition

    Unable to reproduce your error. Here is the sheet that I tested code on. If you are using a different sheet then, you will need to ensure that the layouts and formats are the same as the original, or upload the wkb you are having issues with for analysis. Is your Cell D1 in fact text (a string) or is it something else (ie. number or date?).
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: Get top 10 values from a summary sheet bases on 1 condition

    I see

    I Know why I put your code in the sheet module as I want the macro to automatically run every time the drop down box is changed.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Get top 10 values from a summary sheet bases on 1 condition

    I guess if you told us the whole story at the beginning then you would get code that you wanted.

    If you want it to run on worksheet change, then you need to put it in the worksheet change event and not as a module. You will have to identify the target as D1. You will need to add this to the code. Look here for understanding how the worksheet change event works

    http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

+ 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. [SOLVED] Sum values and create a new summary sheet
    By christopherL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2013, 03:52 AM
  2. [SOLVED] Populate summary sheet with values within specific month column on data sheet...
    By blue91 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2013, 12:11 PM
  3. Copy data from all but a few worksheets into a summary sheet based on condition
    By d_kjellin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2013, 12:27 PM
  4. [SOLVED] Summary sheet - copy cell contents from multiple sheets to one summary sheet
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 10:32 AM
  5. Macro to remove duplicates values and keep unique values bases on multiple criteria
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2011, 04:37 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