Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
Lets say there are 20 items that can possible be chosen
out of a combobox. Lets say I selected the value "April". The value April is the 4th item in the combobox. What is the code that will return 4? I just need a code that will return the location number of the value that I selected. Thank you Todd Huttenstine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
ComboBox1.ListIndex + 1
(The index is zero-based, so the first item has a ListIndex of 0). -- Vasant "Todd Huttenstine" wrote in message ... Lets say there are 20 items that can possible be chosen out of a combobox. Lets say I selected the value "April". The value April is the 4th item in the combobox. What is the code that will return 4? I just need a code that will return the location number of the value that I selected. Thank you Todd Huttenstine |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
Hi Todd
Combo1.ListIndex + 1 (since item 1 is listindex 0 ) HTH. Best wishes Harald "Todd Huttenstine" skrev i melding ... Lets say there are 20 items that can possible be chosen out of a combobox. Lets say I selected the value "April". The value April is the 4th item in the combobox. What is the code that will return 4? I just need a code that will return the location number of the value that I selected. Thank you Todd Huttenstine |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
Hah ... beat you to it!
I must be feeling better ... :) Regards, Vasant. "Harald Staff" wrote in message ... Hi Todd Combo1.ListIndex + 1 (since item 1 is listindex 0 ) HTH. Best wishes Harald "Todd Huttenstine" skrev i melding ... Lets say there are 20 items that can possible be chosen out of a combobox. Lets say I selected the value "April". The value April is the 4th item in the combobox. What is the code that will return 4? I just need a code that will return the location number of the value that I selected. Thank you Todd Huttenstine |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
If you mean VB, you can use the listindex
i = Combo1.Listindex One thing to note is that the listindex property is zero based, so i you are looking for the fourth item in the list, it will have listindex of 3. Also, to get the value for an item where you know the listindex, yo would use: strValue = Combo1.List(1) Which would retrieve the second value in your list. K Edit: Way too slow I see.. -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox Item Number
"Vasant Nanavati" <vasantn *AT* aol *DOT* com skrev i melding
... Hah ... beat you to it! Bah. Fix your system clock! <bg I must be feeling better ... :) Glad to hear that Vasant. Best wishes Harald |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use match function to add different item in Combobox | Excel Worksheet Functions | |||
item limit for a combobox? | Excel Worksheet Functions | |||
Combobox Number Formats | Excel Worksheet Functions | |||
Disable item in combobox | Excel Programming | |||
ComboBox and select item | Excel Programming |