I have a vba user form with several excel drop down lists. I would like the dropdowns to display a list of products. If selected in another dropdown I would like the product to be removed from the other dropdowns.
I have the validation working in the workbook using the worksheets and can setup drop downs that work correctly within a worksheet but when I try to initialize the drop downs in my vba form using the same method I loose the validation.
My VBA drop down lists initialize and show the correct items in my list but aren't removing items that have already been selected.
Here is my code:
Private Sub UserForm_Initialize()
MultiPage2.Value = 0
With MultiPage2.Pages(0).Controls("HostedPBXdesc1")
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
HostedPBXdesc1.List = Range("prodSelect").Value
HostedPBXdesc2.List = Range("prodSelect").Value
HostedPBXdesc3.List = Range("prodSelect").Value
HostedPBXdesc4.List = Range("prodSelect").Value
HostedPBXdesc5.List = Range("prodSelect").Value
HostedPBXdesc6.List = Range("prodSelect").Value
HostedPBXdesc7.List = Range("prodSelect").Value
HostedPBXdesc8.List = Range("prodSelect").Value
HostedPBXdesc9.List = Range("prodSelect").Value
HostedPBXdesc10.List = Range("prodSelect").Value
HostedPBXdesc11.List = Range("prodSelect").Value
HostedPBXdesc12.List = Range("prodSelect").Value
HostedPBXdesc13.List = Range("prodSelect").Value
I'm not sure if that is very clear.
I have the validation working in the workbook using the worksheets and can setup drop downs that work correctly within a worksheet but when I try to initialize the drop downs in my vba form using the same method I loose the validation.
My VBA drop down lists initialize and show the correct items in my list but aren't removing items that have already been selected.
Here is my code:
Private Sub UserForm_Initialize()
MultiPage2.Value = 0
With MultiPage2.Pages(0).Controls("HostedPBXdesc1")
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
HostedPBXdesc1.List = Range("prodSelect").Value
HostedPBXdesc2.List = Range("prodSelect").Value
HostedPBXdesc3.List = Range("prodSelect").Value
HostedPBXdesc4.List = Range("prodSelect").Value
HostedPBXdesc5.List = Range("prodSelect").Value
HostedPBXdesc6.List = Range("prodSelect").Value
HostedPBXdesc7.List = Range("prodSelect").Value
HostedPBXdesc8.List = Range("prodSelect").Value
HostedPBXdesc9.List = Range("prodSelect").Value
HostedPBXdesc10.List = Range("prodSelect").Value
HostedPBXdesc11.List = Range("prodSelect").Value
HostedPBXdesc12.List = Range("prodSelect").Value
HostedPBXdesc13.List = Range("prodSelect").Value
I'm not sure if that is very clear.