Yep.
I'm assuming that the combobox is still on that userform.
If that's correct, take a look at the .listindex property of the combobox.
Option Explicit
Private Sub CommandButton1_Click()
MsgBox Me.ComboBox1.ListIndex
End Sub
The first item on the list will have an index of 0, so...
Option Explicit
Private Sub CommandButton1_Click()
MsgBox Me.ComboBox1.ListIndex + 1
End Sub
If you have something weirder(?) happening, you could always build a table on
another worksheet and use =vlookup() to get the number you want.
trav wrote:
THANKS, that works pretty nice.
just one more question,
in a combo box, is it possible to have a name that is different then
the value.
so if i have a drop down list, say
company
quantity
unit price
sale
can i have a different value associated with them like
company = 1
quantity = 2
unit price = 3
sale = 4
and if so, how do i set that in the form.
--
trav
------------------------------------------------------------------------
trav's Profile: http://www.excelforum.com/member.php...o&userid=31420
View this thread: http://www.excelforum.com/showthread...hreadid=514461
--
Dave Peterson