Thread: dropdown list
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default dropdown list

Remove the line:
If Target.Column = 4 Then
and its End If

cardingtr wrote:
Debra Dalgleish Wrote:

You can do this with programming. There's a sample file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'Select Multiple Items from Dropdown
List'


cardingtr wrote:

Supposed you have a drop down list "1,2,3,4,5,6,7."

How do you make it such that when you click on say 2 on the dropdown
list it will list two then when you click 3 on the same cell, it


will

keep 2 and 3, and so on until you have something like a phrase.
(2,3,5,4..) on the same cell?


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



Thanks for your suggested link.
It works but only for one column at a time. How can I make this formula
to work for all or multiple column in one sheet?
Thanks a lot. Here is the formula:
_________________________
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 4 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& ", " & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub
_________________________




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html