change order of combo box values when pasted to a worksheet

Robertmwaring

New Member
Joined
Mar 8, 2019
Messages
15
Hopefully this will be the last time I need assistance for this project. That being said, it does work and for intents and purposes I do not HAVE to do this, but it would be helpful if I could.

I have a userform <UFProductionSheet> that has 50+ comboboxes on various pages. Not all will be selected, but several can be in any combination. I use the code below to compile a list of all the values that are selected into one column on a sheet within the workbook <Info Sheet>, which is hidden.
[HR][/HR] Dim Ctrl As Object
For Each Ctrl In UFProductionSheet.Controls
If TypeName(Ctrl) = "ComboBox" Then
If Ctrl.Value <> "" Then
Sheets("Info Sheet").Range("AHJ" & Rows.Count).End(xlUp).Offset(1).Value = Ctrl.Value
End If
End If
Next
[HR][/HR]My question is:
Is there a way to ensure the list is compiled in a specific order? Meaning can I assign numbers, similar to the way the TabIndex property works, to the combobox properties so that they are listed according to order or can I accomplish this by some other means? Or do I simply need to live with it?

Thanks in advance -

Robert :)
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,713
Office Version
2007
Platform
Windows
How do you want to sort it?
You can sort by the content of the combos, by the name of the combos, also by the tabindex, you can choose which page first, which one later, etc.
If you have an idea of ​​how you want the sort, we look for the way and help you.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,082
Messages
5,466,537
Members
406,485
Latest member
kaksolver

This Week's Hot Topics

Top