Order of items in ComboBox

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,222
Office Version
  1. 2007
Platform
  1. Windows
Evening,
I have a ComboBox which will start to see more & more entries in its list.
Basically this list is out of order of how i would like to see it.

Very basic example.
I would like to see,
HU56
HU58
HU59
HU100
HU101
Etc etc

The list is as follows,

HU100
HU101
HU56
HU58
HU59

I understand if i add a zero it would then possibly work but i only need it to show like HU59 as opposed to HU059 etc.

Many thanks if you can advise a workaround.
Any code that you need uploading here please ask.

Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Couple questions:

What type of combobox? (I.E.-On a userform or an activeX combobox on a worksheet?)

How are you loading the list? (rowsource....AddItem...what?)
 
Upvote 0
Hi,

It’s that file that you downloaded the other day.
It’s also that same combo box.

Just to advise you I continued to use my existing code as opposed your doodle that you sent me.

Thanks.
 
Upvote 0
Oh the key coding/picking etc userform?

If I remember right, you were using Add and looping through cells on a drop down event to load your combobox, right?

So maybe you could sort them in the cells however you want them to load....??


Not sure what you mean by doodle code, but you're (needless to say) free to use whichever code you wish :)
 
Upvote 0
Hi
From memory I think this list was out of order in the code but it made difference to the order that you see in the combo box.

Can you think of another way as opposed the combo box if that’s easier.
 
Upvote 0
Can you post your code again? I don't typically keep workbooks I download after issues are resolved.

If you have a list on a worksheet, you can use the RowSource property instead.

ComboBox1.RowSource = "Sheet1!A1:A20" 'Or whatever your range is

or if it's always the same, you can even do it in the properties window of the combobox and don't even have to code it.
 
Upvote 0
I looked....they're going to be in the order that you have them on the worksheet ("INFO"). I don't know any way to force it to make the items any order other than that. If you're dead set against re-ordering the items in that worksheet, then I think you're stuck with what you have now.
 
Upvote 0
Hi,
I think the best thing to do is insert a column before the current column named KEY TYPE
I will then put the order of numbers in these cells & use that macro button to sort to the numbers that i specify,this will fix it.

Upon inserting a new column i see that the header colors in the table now change from blue to yellow etc.
Can you advise where i need to make the edit to bring the colors back to how they were as i assume adding a new column has put something out of joint.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,411
Members
448,894
Latest member
spenstar

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