Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default converting letters to numbers

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting text to negative numbers! via135 Excel Worksheet Functions 6 February 5th 06 06:29 AM
converting numbers to text gls858 New Users to Excel 2 October 18th 05 10:56 PM
Converting negative/positive numbers to a CSV (Comma-delimited .TX Frustrated Excel user Excel Worksheet Functions 2 August 17th 05 05:51 PM
Converting numbers formatted as text to numbers Bill Excel Discussion (Misc queries) 1 July 19th 05 07:10 PM
How do I sort letters before numbers in Excel? RiverGirl Excel Discussion (Misc queries) 4 May 27th 05 04:09 PM


All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"