Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel Drop Down lists


I've created a spreadsheet with a drop down list, however, i want the user
to be able to select an from a list of options, which would then poplulate
the cell with an associated code

If they selected "slate" from the list below, the information put into the
cell would be SL, any idea or advice on how i do this?

Kindest regards

Marta


Slate SL


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Excel Drop Down lists

Begin by selecting that cell and choosing Data Validation again and go to the
[Error Alert] tab and clear the checkbox that says to show an error message
when an entry not in the list is entered into the cell.

Put code similar to this into the worksheet's event code module and edit it
as needed:
Private Sub Worksheet_Change(ByVal Target As Range)
'change this address as required
'this is the address of the cell with
'the list to select from in in and
'for this purpose you must include
'the $ symbol before the column & row
'portions of the address
If Target.Address < "$D$1" Then
'not the right cell
Exit Sub
End If
Select Case LCase(Target.Value)
'make sure you spell the
'words in the list in
'all lowercase for the
'tests here
Case Is = "slate"
Target = "SL"
Case Is = "steel"
Target = "ST"
Case Is = "silver"
Target = "SI"
'add more Case Is =
'statements as needed
Case Else
'do nothing
End Select

End Sub

To put the code in the right place, select that worksheet and right-click on
its name tab and choose [View Code] from the list. That will open up the
proper code module and you can copy the code above and paste it into the
module, make needed edits and then close the VB editor.


"Marta123" wrote:


I've created a spreadsheet with a drop down list, however, i want the user
to be able to select an from a list of options, which would then poplulate
the cell with an associated code

If they selected "slate" from the list below, the information put into the
cell would be SL, any idea or advice on how i do this?

Kindest regards

Marta


Slate SL


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
Excel Drop Down Lists biggles592 Excel Worksheet Functions 9 March 5th 10 02:54 AM
Drop down lists in excel Judy Excel Discussion (Misc queries) 3 November 24th 08 10:47 PM
Excel Drop-down lists AMSH Excel Discussion (Misc queries) 0 November 18th 08 03:09 AM
Excel drop down lists DougMcD Excel Discussion (Misc queries) 8 February 27th 08 08:26 PM
Multiple lists with repeated values for dependet drop down lists mcmanusb Excel Worksheet Functions 1 September 29th 06 12:13 AM


All times are GMT +1. The time now is 02:17 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"