View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default Help...Using dropdown list

When you setup the Data Validation, uncheck the "Show error alert after
invalid data is entered" box in the "Error Alert tab".
Then the following macro will do what you want. Note that this is a
worksheet macro and must be placed in the sheet module of the sheet that has
the drop-down cell. I assumed the drop-down cell is E2. To access the
sheet module, right-click on the sheet tab, select View Code. Paste this
macro into that module. "X" out of the module to return to the worksheet.
HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Not Intersect(Target, Range("E2")) Is Nothing Then
Application.EnableEvents = False
Select Case Target.Value
Case "Project in town": Target.Value = 1
Case "Project out of town": Target.Value = 2
Case "Project on the road": Target.Value = 3
Case "Projeect anywhere": Target.Value = 4
End Select
Application.EnableEvents = True
End If
End Sub

"modicon2" wrote in
message ...

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