Use the object.AddItem and object.List properties [object.list(row, column)]
With ComboBox1 'Rename ComboBox1 to the name of your control
.Additem "Your Text here"
.List(0, 1) = "1" 'Or any other value you assign
.Additem "Text line two"
.List(1, 1) = "2"
.Additem "Text line three"
.List(2, 1) = "3"
End With
'If you don't use the 'With' statement then it would be more typing.
'Like so:
ComboBox1.Additem "Your Text here"
ComboBox1.List(0, 1) = "1" 'Or any other value you assign
ComboBox1.Additem "Text line two"
ComboBox1.List(1, 1) = "2"
ComboBox1.Additem "Text line three"
ComboBox1.List(2, 1) = "3"
'For more information, look in the Help guide for AddItem and List
'Hope this helps
clara said:
Hi all,
My dropdown combo has two columns, one is for text and one is for value.
When coding, is it possible to assign a text to it while the corresponding
value is also assigned to it?
Clara