nuberun
asked on
value and text in combo Excel vba
Hello,
I want to know if it's possible to assign value and text information to a combo in vba to show the text and make the queries with the value.
Thanks in advance.
I want to know if it's possible to assign value and text information to a combo in vba to show the text and make the queries with the value.
Thanks in advance.
Addition to above comment
You can get the value item by
1st method using the itemdata
dim x
x = combo1.itemdata(combo1.lis tindex)
2nd method
suppose arrlist is the string array
dim x
x = arrlist(combo1.listindex)
Hope this will serve the purpose
You can get the value item by
1st method using the itemdata
dim x
x = combo1.itemdata(combo1.lis
2nd method
suppose arrlist is the string array
dim x
x = arrlist(combo1.listindex)
Hope this will serve the purpose
ASKER
Hi,
Thanks for your assistance but I don't have the itemdata property in the combo box.
Regards
Thanks for your assistance but I don't have the itemdata property in the combo box.
Regards
Ur application is in Visual Basic right..
ASKER
This part is in Excel, using vba. In vb.net there is the option to assign the value and text to be displayed. I want to be able to do the same in Excel vba.
Thanks for your help
Thanks for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I believe my post answers the question (conceptual answer as well as a link)
you can set the value data using the itemdata of a combobox
eg.
Combo1.AddItem "Assyst"
Combo1.ItemData(Combo1.New
if your value field is not a number field. you can make use of a string array and get the
required value data in the click event using the listindex as the array index.
Good Luck