Is there a way to limit a list box to cells that have not already been selected. Ex:
list box in A:A is linked to D1:D4 (contents a,b,c,d). If someone selects “a” in the list box, how can we prevent them from selecting it a second time?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » List Box (2000)
The only way I can imagine doing it is to create the comboboxes all individually. Each one when selected would check the master list and only add the items “available” for selecting to the list (via code)
The problem is that once all the items have been selected, none of them could be changed since there would be nothing new to select, though you could add a button to “reset” them all.
Steve
The only way I can imagine doing it is to create the comboboxes all individually. Each one when selected would check the master list and only add the items “available” for selecting to the list (via code)
The problem is that once all the items have been selected, none of them could be changed since there would be nothing new to select, though you could add a button to “reset” them all.
Steve
You could delete the cell containing the value selected so that next time it will be missing from the validation list. The Worksheet Change event can be employed here. I think using named ranges might be best and in the following example I have named Range A2:A13 as Inputs and C2:C13 as SelectList. This range would just hold the values (no need for countif formulas). The following code (no error checking included) should then take care of the validation list :
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, [Inputs]) Is Nothing Then [SelectList].Find(Target.Text, LookIn:=xlValues).Delete End If End Sub
I attach an amended version of your workbook with this implemented.
You will of course need to re-engineer the original list should you need to reset.
Andrew C
If you type in the item the it works fine. But if you use the pick list to select (as many people might) the data validation does not trigger a change event and it does not work.
I think you could do an approach like this, but use the comboboxes and not validation. I do not think there is any real good way to “capture the validation event”.
Steve
If you type in the item the it works fine. But if you use the pick list to select (as many people might) the data validation does not trigger a change event and it does not work.
I think you could do an approach like this, but use the comboboxes and not validation. I do not think there is any real good way to “capture the validation event”.
Steve
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.