+ Reply to Thread
Results 1 to 24 of 24

Data Validation Hide Previously Used Items in Dropdown

  1. #1
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Data Validation Hide Previously Used Items in Dropdown

    I would like to take my son's little league baseball team roster and create a drop down list that shrinks as it is used. I will try to explain more clearly below and have attached a mock file that would help best.

    I have 12 players with uniform numbers 1-12. I have named the players names "PLAYERS" and used a VLOOKUP to access their uniform numbers in the defined group called "UNIFORMS". For each inning, I would like to make sure I use each field postion/player once and only once so as the position/player is used up it doesn't show up in the validation drop down list again (I also defined the positions as "POSITIONS"). This prevents me from placing two different players in the same position within the same inning and creating confusion at game time. Column D is an example of a good setup with all positions/players used once and Column E is an error because of multiple posistions. Note: There are supposed to be (2) SIT positions as this age group has 10 field players and 12 players per team which means two players will need to sit each inning.
    Attached Files Attached Files
    Last edited by cheddarthief; 04-28-2010 at 05:02 PM. Reason: Not actually solved

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Data Validation Drop Down List that shrinks as used

    G'day

    Just what's based on your title thread try this

    http://www.contextures.com/xlDataVal03.html

    I will be back later after work if more help is needed.

    Cheers

    RC
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  3. #3
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Drop Down List that shrinks as used

    I read it but didn't understand it completely. It's not a very clear posting. Any chance you could apply it to my mock Excel file and re-attach it so I can see how it's supposed to work?

    Jim

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Data Validation Hide Previously Used Items in Dropdown

    Exactly what in the tutorial posted by ratcat is unclear?

  5. #5
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    I tried to apply the priciples but kept getting errors mostly about loop conditions. I just need a little help to get going. Something to let me know what the format should look like and I can take it from there.

    Also, is it possible to hide information based off previously used items in both the column and row information? For example, each player can only play one position per inning, which is the original request of this thread. But, each player can only play the same position twice per game. So as you can see, if a player is in the "P" position in the 1st and 2nd innings, he can't play their again the rest of the game. So I was wondering if there was a way to accomplish both conditions at the same time.

    Jim
    Last edited by cheddarthief; 04-28-2010 at 08:58 AM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    Have a look at the attached.

    Basically I did as per the Contextures tutorial.

    You need to repeat the process for each inning.. with 6 independent sets of formulas and named ranges.

    For the SITs, I would suggest you add 2 more items to list in Column A, called something like SIT1 and SIT2 and expand all the formulas and named ranges and data validations to include these 2 items.
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    I tried adding the actual field positions to your grid on the right and then tried putting them into the table on the left. It did not hide the positions as they were used. To be honest, I'm not even sure what the values in columns J thru O have to do with how this works. I saw before I added the correct fielding positions that as each one was added to the table numbers disappeared from columns J thru O but I don't understand why plus I don't see why it starts at 3 and goes up to 14. I'm just confused.

    Note that their is information on the second worksheet as well.

    Jim
    Attached Files Attached Files

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    For now ignore all the formulas in columns J onward....

    In the sheet I attached, go to D3 and pick a position from the dropdown list.

    Now go to D4 and click the dropdown arrow.. do you see the position that you selected in D3 appear in the list? You shouldn't.

    The formulas in J onward are all used to determine this condensed list setting.

    You can hide those columns if you wish, but don't change them, unless you are adding to what you have in Column A.

    The data Validation list you had called "Positions" is no longer valid for columns D to I.

    My extra suggestion for the 2 SIT positions is to go to column A in the Batting order sheet and add SIT1 and SIT2 to cells A15 and A16, then you would adjust all the formulas in Columns J to U to accomodate the new range and you would need to adjust the named range formulas for each of the named ranges: Inning1 to Inning6... then you would add data validation to rows 15 and 16 in columns D to I by copying formats from row 14...

  9. #9
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    When I use your origina sheet, you are correct. The dropdown does hide the used values as they are put into column D. However, if you look at the new attached worksheet I submitted with my last post you will see that your original positions (1st thru 12th) do not really work. I am actually looking to fill the "defensive" positions of my players, not the batting order. The batting order is already determined in Column A of the first worksheet. 1st thru 12th is a constant and never needs to change. The players' names in column B and their defensive positions in columns D thru I are the only things that change. I might not have been clear in the beginning of my post. I am a newbie and tend to make that mistake. Sorry.

    Jim

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    Try this:

    Change formula in J3 to: =IF(COUNTIF(D$3:D$14,POSITIONS)>=1,"",ROW()-2) and copy it down to J14, then copy them across to column O.

    Change formula in P3 to: =IF(ROW(A3)-ROW(A$3)+1>COUNT(J$3:J$14),"", INDEX(POSITIONS,SMALL(J$3:J$14,1+ROW(A3)-ROW(A$3))))

    and copy down to P14 and across to column U.

    In Sheet2, change SIT in C11 and C12 to SIT1 and SIT2, respectively.

    Now test the data validations... is that what you want?

  11. #11
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    Nope. Didn't work. When I go into say cell D3 and select "P" from the drop down validation then go to D4, "P" should not be in the list. However, it still is. What DID get removed from the list was "3rd" which is strange. In column J, the value "3" in row 5 is now empty and in column P, the value "3rd" is gone. I tried to mess with the formula but it just got worse. Any ideas?

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    Hopefully, I got my act together this time.

    Change formula in J3 to:

    =IF(COUNTIF(D$3:D$14,Sheet2!$C1)>=1,"",ROW()-2) and copy down and across to column O

    Formula in P3 should remain as:

    =IF(ROW(A3)-ROW(A$3)+1>COUNT(J$3:J$14),"", INDEX(POSITIONS,SMALL(J$3:J$14,1+ROW(A3)-ROW(A$3))))

    copied down and across.

    Remember to change the SITE cells in the other sheet.

  13. #13
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    That did it. Now I just need to do the same for the player information. I tried to apply the same formulas but didn't get the correct results with the 1-12 values like those in column J. Shouldn't my new column return the same 1-12 values?

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    In V3:

    Please Login or Register  to view this content.
    copied down

    In W3:

    Please Login or Register  to view this content.
    Then create a new named range: PlayerList with formula:

    Please Login or Register  to view this content.
    Then change data validation in B3:B14 to =PlayerList

  15. #15
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Data Validation Hide Previously Used Items in Dropdown

    G'day All,

    Without reading through all the thread I look a NBVC attachment and seems to be a couple of typos

    Here's a working example


    Edit: About NBVC attachment Just worked it out its amazing by just missing a $ sign can screw things up

    Try this at J3 =IF(COUNTIF(D$3:D$14,$A3)>=1,"",ROW()) and copy down and across to Col O and the sheet will start to work
    Attached Files Attached Files
    Last edited by ratcat; 04-28-2010 at 04:18 PM. Reason: See Edit

  16. #16
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    That's the ticket. Actually, I had to copy back the information from the mock file I gave you back to my master file. The cell ranges were all different and it took me a bit to figure out how the code actually works so I could fix the cells in the formulas. But it's working great now. Thanks for the help. This will help many confused baseball coaches in our league.

    Jim

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    You are welcome.

    Ratcat, I know the last attachment had some issues... but I think we cleared them up after post 12 above.

  18. #18
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Data Validation Hide Previously Used Items in Dropdown

    Okay ! that's great news NBVC and for Jim who seems to grasps the workings of the formulas to achieve the result he's looking for.

    Btw it took me about half an hour when I first learn it to get it working lol

    Cheers

    RC

  19. #19
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    Ok, I was wrong. I did something wrong and I'm not sure what. I have posted my actual spreadsheet. Maybe you can see what I've done wrong.

    When I filled in my actual players names for the batting order, columns started disapearing to the right so when I went to fill in the actual fielding positions, I could only put in 3 positions then no longer had drop downs.

    HELP!!! LOL
    Attached Files Attached Files

  20. #20
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    It seems you made the rows absolute instead of the column in formulas starting in column U

    So U3 should be:

    =IF(COUNTIF(D$3:D$14,$AH3)>=1,"",ROW()-2)

    copied down and across to Z14

  21. #21
    Forum Contributor
    Join Date
    02-20-2010
    Location
    Youngstown, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Data Validation Hide Previously Used Items in Dropdown

    Ah!!! Stupid mistake. I should have saw that. Thanks so much. Sometimes you can look at it so long you don't even see the mistakes. Thanks a ton again.

    Jim

  22. #22
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation Hide Previously Used Items in Dropdown

    You are welcome,

    Please note that if you are going to do some separate tables below with then the formulas in say U18, would need a bit of adjustment.. i.e. =IF(COUNTIF(D$19:D$30,$AH19)>=1,"",ROW()-18)

    and in AA18:

    =IF(ROW(A19)-ROW(A$19)+1>COUNT($U$19:$U$30),"", INDEX($AH$19:$AH$30,SMALL($U$19:$U$30,1+ROW(A19)-ROW($A$19))))

    assuming you have separate Player lists, etc in same relative positions for that column

  23. #23
    Registered User
    Join Date
    07-10-2020
    Location
    Muscat
    MS-Off Ver
    Excel 2016
    Posts
    2

    Re: Data Validation Hide Previously Used Items in Dropdown

    Hi All,
    I have similar need to hide used items from drop drown list like selecting the base ball team for multiple innings.
    The concern is in my application i have unlimited innings i need to choose the teams for. Is there any VBA codes to achieve this.

  24. #24
    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,938

    Re: Data Validation Hide Previously Used Items in Dropdown

    Quote Originally Posted by Sridhar Kollepara View Post
    Hi All,
    I have similar need to hide used items from drop drown list like selecting the base ball team for multiple innings.
    The concern is in my application i have unlimited innings i need to choose the teams for. Is there any VBA codes to achieve this.
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    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

+ 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