Hello!
I used the code from this dependent combobox thread:
http://www.excelforum.com/excel-prog...mbo-boxes.html
Woorkbook: Copy of Combo Box.xlsm
to create a list of unique items in my comboBoxes, and control the autofilter. But the items in the combobox are not in alphabetical/numerical order... how could I accomplish this?
Have you tried sorting them alphabetically first and then adding them to the combo box?
Please leave a message after the beep!
Hi lnk2013
Check this link. It includes a download sample file for you to play with. C:\VBA Code\ComboBox\VBA ExpressExce...dered list.mht
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
This will sort a combobox or listbox:
E.g.,Function SortTheBox(vCtl As Variant) As Boolean Dim i As Long Dim j As Long If Not IsObject(vCtl) Then Exit Function Select Case TypeName(vCtl) Case "ComboBox", "ListBox" With vCtl For i = 1 To .ListCount - 1 For j = 0 To i - 1 If .List(i) < .List(j) Then .AddItem .List(i), j .RemoveItem i + 1 Exit For End If Next j Next i End With SortTheBox = True End Select End Function
SortTheBox ComboBox1
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks