+ Reply to Thread
Results 1 to 10 of 10

Display needed info on different worksheet

  1. #1
    Registered User
    Join Date
    09-06-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    7

    Cool Display needed info on different worksheet

    I'm just new in using VBA, I created a simple problem that I can't figure out how to solve in worksheet 2, I have 3 worksheets.

    1. Players - Complete info of players

    2. Members - When I select the team name, I'd like to display the info First Name, Last Name and Team only for the team name I've chosen. This should automatically change whenever I select a team name.

    3. Team Codes - Tables I used for my vlookup and drop down list.

    I have attached my file for your reference.

    Thank you very much!
    Attached Files Attached Files
    Last edited by netwarrior; 09-10-2009 at 12:10 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Display needed info on different worksheet

    A5=1
    A6=2
    A7=3

    B5:
    =INDEX(Players!$B$1:$B$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)

    C5:
    =INDEX(Players!$A$1:$A$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)

    D5:
    =INDEX(Players!$D$1:$D$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)


    NOTE:
    These array formulas are fine on small datasets. If your data is going to grow into the 100s or even 1000s, I'd have other approaches to suggest.
    Last edited by JBeaucaire; 09-07-2009 at 02:23 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Display needed info on different worksheet

    [edit - removed - see post 7]
    Last edited by DonkeyOte; 09-07-2009 at 03:02 AM.

  4. #4
    Registered User
    Join Date
    09-06-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    7

    Cool Re: Display needed info on different worksheet

    Quote Originally Posted by JBeaucaire View Post
    A5=1
    A6=2
    A7=3

    B5:
    =INDEX(Players!$B$1:$B$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)

    C5:
    =INDEX(Players!$A$1:$A$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)

    D5:
    =INDEX(Players!$D$1:$D$10, SMALL(IF(Players!$E$1:$E$10=$B$2, ROW($A$1:$A$10), ""), $A5))
    (confirmed with CTRL-SHIFT-ENTER to activate the array, then copy down)


    NOTE:
    These array formulas are fine on small datasets. If your data is going to grow into the 100s or even 1000s, I'd have other approaches to suggest.

    @JB,

    Thank you very much for you quick reply, but i'm recieving an error #NUM!, and please I would like to know also how to deal with 100s or more data, this is just my example, if applied to real world more data is applicable.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-06-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Display needed info on different worksheet

    @JB

    sorry, for being such a novice, your formula is working great, i forgot to type the number on column A, now what if my data is in 100s? thank you very much again!
    Last edited by netwarrior; 09-07-2009 at 02:59 AM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Display needed info on different worksheet

    It's up to you if this works or not. I know the values are probably appearing, but you'll have to watch your sheet's "performance" with a bunch of these formulas active.

    Does your sheet slow down perceptibly? If not, you're good.

    If so, you'll have to consider adding "helper columns" to provide indexes we can use to sort these people without needing array formulas. Let us know.

    ==========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Display needed info on different worksheet

    I'm a doofus too as I misread JB's formula in the first place !

    JB - I've removed my "other" post... too early !

  8. #8
    Registered User
    Join Date
    09-06-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    7

    Cool Re: Display needed info on different worksheet

    @all
    i was out of town for a while haven't replied again. thanks guys for your help!

    @JB
    i tried to add some names but when i change the team, it's not updating properly unlike the 1st one you did. the result should be updated when we add, delete or change the data. i attached my working file for your reference. thanks again!

    just to remind us that our aim here is to display info on per team only. we don't want to see all teams in 1 page.
    Attached Files Attached Files
    Last edited by netwarrior; 09-09-2009 at 02:18 AM.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Display needed info on different worksheet

    OK, added some stuff to make it more dynamic:

    1) A4 - has a count of how many team members there are total for the chosen color
    2) The numbers going down column A will add/remove themselves (down to row 30, copy that formula down further if needed)
    3) The chart will now expand and contract with the numbers in column A (down to row 30, copy the formulas/formatting down further if needed)
    4) Added some conditional formatting to the chart so even the borders match.
    5) Chart now watching 100 rows of Players sheet.
    Attached Files Attached Files
    Last edited by JBeaucaire; 09-09-2009 at 12:06 PM.

  10. #10
    Registered User
    Join Date
    09-06-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    7

    Thumbs up Re: Display needed info on different worksheet

    Quote Originally Posted by JBeaucaire View Post
    OK, added some stuff to make it more dynamic:

    1) A4 - has a count of how many team members there are total for the chosen color
    2) The numbers going down column A will add/remove themselves (down to row 30, copy that formula down further if needed)
    3) The chart will now expand and contract with the numbers in column A (down to row 30, copy the formulas/formatting down further if needed)
    4) Added some conditional formatting to the chart so even the borders match.
    5) Chart now watching 100 rows of Players sheet.
    wow! JB, thank you so much! you solved my problem!

    +1 RF to you!

+ 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