View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
scottfoxall scottfoxall is offline
external usenet poster
 
Posts: 40
Default Help...Using dropdown list

OK, Follow this step by step

First

VIEW TOOLBARS CONTROL TOOLBOX

A small toolbar is activated. Click the triangle to go into design mode.

Drag and drop a combobox (Drop down) onto the spread sheet.

Then select the Combo and right click properties.

Then look for listFillRange and type the data range in for the drop down,
example A1:A15

Then

Double click the combobox

You should see

Private Sub ComboBox1_Change()


End Sub


Paste this code inbetween the above comments so it looks like:

Private Sub ComboBox1_Change()
Dim Project,Count,Search

Project = ComboBox1.Value
Count = 1

While Search = "ON"
If Project = Range("A1").Offset(Count, 0).Value Then
Range("B5").Value = Count
Search = "OFF"
Else
If Project = "" Then
Search = "OFF"
End If
Count = Count + 1
End If
Wend

End Sub

The above code assumes you list range is starts at A1

Edit this to your actual start of list

It also puts the number in to cell B5

Again, edit this to your required destination

Regards



"modicon2" wrote:


Greetings,
I need to select an item from a dropdown list but display a different
name/number.
For example:
My dropdown list contains the following items:
Project in town
Project out of town
Project on the road
Projeect anywhere

I want to select the dropdown list and see the items listed above but
when I select an item, I want just a number to showup in the cell.

exm1: If I selected "Project in town" from dropdown, then a "1" would
be displayed in the cell.

exm2: If I selected "Project out of town" from dropdown, then a "2"
would be displayed in the cell.

I can make a list and set the dropdown to display that list by using
Data..Validation..allow:list...then select data range.

Thanks!


--
modicon2
------------------------------------------------------------------------
modicon2's Profile: http://www.excelforum.com/member.php...fo&userid=4158
View this thread: http://www.excelforum.com/showthread...hreadid=573943