Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Drop Down list with Code Description

I was looking for a way to show a code description when choosing from
multiple values in a single cell.

Example

I have these codes and their definitions in a spreadsheet
A - Architecture
C - Civil
E - Electrical

I only see the following below to choose from in my list which might
not be a big help for some people.
A
B
C

I only want to see A show up in the cell but I would like to see "A -
Architecture" show up in the drop down list.

Can this be done?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default Drop Down list with Code Description

On your Data Validation, there are 3 tabs. The second tab is the INPUT
message. you can give it a name, and put descriptive information in the box.
In addition, there is a 3rd tab, Error Alert, where if they try to put
incorrect data, you can tell xl what to say is the error, how to correct,
basically anything you want.
--
John C


" wrote:

I was looking for a way to show a code description when choosing from
multiple values in a single cell.

Example

I have these codes and their definitions in a spreadsheet
A - Architecture
C - Civil
E - Electrical

I only see the following below to choose from in my list which might
not be a big help for some people.
A
B
C

I only want to see A show up in the cell but I would like to see "A -
Architecture" show up in the drop down list.

Can this be done?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Drop Down list with Code Description

With VBA you can have the drop-down list show the whole thing (A -
Architecture for instance), then show just the "A" after a selection is
made. You would setup the Data Validation to not display an error alert
when a wrong entry is made. A macro like the following would work. This is
a sheet event macro and must be placed in the sheet module of your sheet.
To access that module, right-click on the sheet tab, select View Code, and
paste this macro into that module. "X" out of the module to return to your
sheet.
You will need to add all the other list items and the corresponding single
letter that you want in the code. Post back if you need more. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
If IsEmpty(Target.Value) Then Exit Sub
Application.EnableEvents = False
Select Case Target.Value
Case "A - Architecture": Target.Value = "A"
Case "C - Civil": Target.Value = "C"
Case "E - Electrical": Target.Value = "E"
End Select
Application.EnableEvents = True
End If
End Sub
wrote in message
...
I was looking for a way to show a code description when choosing from
multiple values in a single cell.

Example

I have these codes and their definitions in a spreadsheet
A - Architecture
C - Civil
E - Electrical

I only see the following below to choose from in my list which might
not be a big help for some people.
A
B
C

I only want to see A show up in the cell but I would like to see "A -
Architecture" show up in the drop down list.

Can this be done?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Drop Down list with Code Description

On Aug 12, 6:15*pm, "Otto Moehrbach"
wrote:
With VBA you can have the drop-down list show the whole thing (A -
Architecture for instance), then show just the "A" after a selection is
made. *You would setup the Data Validation to not display an error alert
when a wrong entry is made. *A macro like the following would work. *This is
a sheet event macro and must be placed in the sheet module of your sheet.
To access that module, right-click on the sheet tab, select View Code, and
paste this macro into that module. *"X" out of the module to return to your
sheet.
You will need to add all the other list items and the corresponding single
letter that you want in the code. *Post back if you need more. *HTH *Otto
Private Sub Worksheet_Change(ByVal Target As Range)
* * If Target.Count 1 Then Exit Sub
* * If Not Intersect(Target, Range("A1")) Is Nothing Then
* * * * If IsEmpty(Target.Value) Then Exit Sub
* * * * Application.EnableEvents = False
* * * * Select Case Target.Value
* * * * * * Case "A - Architecture": Target.Value = "A"
* * * * * * Case "C - Civil": Target.Value = "C"
* * * * * * Case "E - Electrical": Target.Value = "E"
* * * * End Select
* * * * Application.EnableEvents = True
* * End If
End wrote in message

...



I was looking for a way to show a code description when choosing from
multiple values in a single cell.


Example


I *have these codes and their definitions in a spreadsheet
A - Architecture
C - Civil
E - Electrical


I only see the following below to choose from in my list which might
not be a *big help for some people.
A
B
C


I only want to see A show up in the cell but I would like to see "A -
Architecture" show up in the drop down list.


Can this be done?


Thanks- Hide quoted text -


- Show quoted text -


Thanks, worked like a charm
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Drop Down list with Code Description

You're welcome. Thanks for the feedback. Otto
wrote in message
...
On Aug 12, 6:15 pm, "Otto Moehrbach"
wrote:
With VBA you can have the drop-down list show the whole thing (A -
Architecture for instance), then show just the "A" after a selection is
made. You would setup the Data Validation to not display an error alert
when a wrong entry is made. A macro like the following would work. This is
a sheet event macro and must be placed in the sheet module of your sheet.
To access that module, right-click on the sheet tab, select View Code, and
paste this macro into that module. "X" out of the module to return to your
sheet.
You will need to add all the other list items and the corresponding single
letter that you want in the code. Post back if you need more. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
If IsEmpty(Target.Value) Then Exit Sub
Application.EnableEvents = False
Select Case Target.Value
Case "A - Architecture": Target.Value = "A"
Case "C - Civil": Target.Value = "C"
Case "E - Electrical": Target.Value = "E"
End Select
Application.EnableEvents = True
End If
End wrote in message

...



I was looking for a way to show a code description when choosing from
multiple values in a single cell.


Example


I have these codes and their definitions in a spreadsheet
A - Architecture
C - Civil
E - Electrical


I only see the following below to choose from in my list which might
not be a big help for some people.
A
B
C


I only want to see A show up in the cell but I would like to see "A -
Architecture" show up in the drop down list.


Can this be done?


Thanks- Hide quoted text -


- Show quoted text -


Thanks, worked like a charm

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
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
code to delete sheets not in use based on a cell's drop down list kangasnat Excel Worksheet Functions 2 September 20th 07 03:08 AM
Select stock code depending on description in next column sako 338 Excel Worksheet Functions 4 March 1st 07 02:32 AM
Code to an in cell drop down list frendabrenda1 Excel Discussion (Misc queries) 4 September 1st 05 08:06 PM
How do I color code items in a drop down list? Beckers1986 Excel Discussion (Misc queries) 1 January 23rd 05 02:02 PM


All times are GMT +1. The time now is 01:21 PM.

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"