Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default drop down menu

I want to put a drop down menu (the same menu) in 10 different rows in the
same column. I want the list to say, for example 990 - LWOP. But when
they select, I only want the 990 to be entered in the cell.

Suggestions, please, and thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default drop down menu

The following example uses DataValidation and an event macro.

Put the following event macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A1"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = Left(Target.Value, 3)
Application.EnableEvents = True
End Sub

Then enter and run:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/30/2009 by James Ravenswood
'

'
Range("A1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$J$1:$J$3"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With
Range("J1").Value = "100 - stuff"
Range("J2").Value = "200 - more stuff"
Range("J3").Value = "300 - excess stuff"
End Sub

Macro1 sets up a very simple data validation in cell A1. The event macro
simply keps only the first three characters from what the user selects.
--
Gary''s Student - gsnu200909


"Gator Girl" wrote:

I want to put a drop down menu (the same menu) in 10 different rows in the
same column. I want the list to say, for example 990 - LWOP. But when
they select, I only want the 990 to be entered in the cell.

Suggestions, please, and thank you.

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 dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Excel Worksheet Functions 1 June 4th 08 02:21 PM
filter dropdown menu so 2nd drop menu is customized menugal Excel Worksheet Functions 1 September 4th 07 05:25 PM
Drop-down menu referencing another drop-down menu? Tushar Mehta Excel Programming 0 January 13th 07 12:38 PM
Drop-down menu referencing another drop-down menu? Debra Dalgleish Excel Programming 0 January 12th 07 07:03 PM
Cross-referenced drop-down menu (nested drop-downs?) creativeops Excel Worksheet Functions 4 November 22nd 05 05:41 PM


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