I am trying to go through a list of comboboxs and set the selected value from the itemdata.
So far I have this working for a single combo. I have a few combo's that I need to do this for and was trying to find a way to pass the combobox through to a sub to do this. I am not sure how this would work so any help is greatly appreciated
'No idea how to set the combo = control on form Private Sub SelectCBO(ItemID As Long, combo As "comboboxControl") Dim i As Long combo.ListIndex = -1 combo.Text = "" For i = 0 To combo.ListCount - 1 If combo.ItemData(i) = ItemID Then combo.ListIndex = i combo.Text = combo.List(i) Exit For End If Next End Sub SelectCB0(.itemID, cboCombobox) SelectCBO(.itemID2, cboCombobox2)