#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combo Box

Hi

I have created a dropdown box (Combo) and have initailised
it by placing values in it via the Form_Load()Command

eg lstOneCol.additem "Buses"

The user thus selects a value from the list at runtime -
now is when my VB memory fails me. The chosen option is
in text form I need it in numericals so that I can perform
a calculation on it

eg the user choses "Buses" from the dropdown list. I then
need to be able to relate this to a value i.e. 23 (miles
to the gallon) with which I can put in equations etc. I
just cannot remember how to do this


THanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combo Box

In Excel, you can do this:

Maybe you have a table with

Buses 23
Cars 40

you could use a Vlookup formula

res =
Application.Vlookup(combobox1.Value,worksheets("Da ta").Range("A1:B20"),2,Fal
se)

--
Regards,
Tom Ogilvy


Davo wrote in message
...
Hi

I have created a dropdown box (Combo) and have initailised
it by placing values in it via the Form_Load()Command

eg lstOneCol.additem "Buses"

The user thus selects a value from the list at runtime -
now is when my VB memory fails me. The chosen option is
in text form I need it in numericals so that I can perform
a calculation on it

eg the user choses "Buses" from the dropdown list. I then
need to be able to relate this to a value i.e. 23 (miles
to the gallon) with which I can put in equations etc. I
just cannot remember how to do this


THanks in advance.




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
How do I create a combo box that is tied to another combo box? rosamaria Excel Worksheet Functions 2 December 9th 09 10:32 PM
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM


All times are GMT +1. The time now is 06:55 AM.

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

About Us

"It's about Microsoft Excel"