Combobox List does not include duplicates & other

MFish

Board Regular
Joined
May 9, 2019
Messages
76
Hi, is it possible for the combobox.list to not show duplicates? Here's the code I have...

Code:
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False

With Worksheets("Input new run")
   Me.cmbDelLH.List = .Range("B7", .Range("B7").End(xlDown)).Value
   Me.cmbLegDel.List = .Range("c7", .Range("C7").End(xlDown)).Value
   
End With

End Sub

In column "B" I will have a lot of duplicates. Is there a way for the list to only be the "What's new" and not duplicated items? Example:

Column B Column C
A
1
A
2
B
1
B
2
B
3

<tbody>
</tbody>

Basically in the first combobox it will only show two items to choose from... A and B.

Now, is it possible to only show the list in combobox2 off of what was chosen in combobox1? In this case if I were to select selection "A", in combobox1, then in combobox2 it will only show the values of "1, 2" and leaving out 3 because the first combobox is selected on A, respective to the data above, offset(0,1)?
 
Hey Fluff,

So I input the code in and the first combobox1, named cmbDelLh will have the correct information when the drop down is selected, yet once I try to hit a selection it comes back as a runtime error of: 91 and highlights...
Not quite sure why you would get that error, do you want to pursue this, or are you happy to run with Dante's code?
 
Last edited:
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,108
Messages
6,123,131
Members
449,097
Latest member
mlckr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top