Scott Huish
MrExcel MVP
- Joined
- Mar 17, 2004
- Messages
- 20,638
- Office Version
- 365
- Platform
- Windows
So, I'm building a form like this:
First column is lstBrandsAvailable, 2nd column is lstBrandsSelected
If I click Add, I don't want it to add it if it has already been selected.
This is what I have now but I don't know what kind of loop to do to check and see if it's lstBrandsSelected yet or not.
I have tried to search for answers for this but I am stuck, nothing quite seems to fit exactly what I'm trying to do.
First column is lstBrandsAvailable, 2nd column is lstBrandsSelected
If I click Add, I don't want it to add it if it has already been selected.
This is what I have now but I don't know what kind of loop to do to check and see if it's lstBrandsSelected yet or not.
VBA Code:
Private Sub cmdAdd_Click()
Set available = UserForm1.lstBrandsAvailable: Set selectedbrand = UserForm1.lstBrandsSelected
selectedbrand.AddItem available.Value
End Sub
I have tried to search for answers for this but I am stuck, nothing quite seems to fit exactly what I'm trying to do.