View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Augusta Augusta is offline
external usenet poster
 
Posts: 3
Default Multiple choice in dropdown list

I need to reformulate my question.

The thing is I found in the file how to apply the option for different
columns, but it inserts the options in different rows.

In the example below the options are added in the same cell with line
breaks. How could I apply it to another column according to what is written
below?

Thank you.
__________________________

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 = 19 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& Chr(10) & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub



"Augusta" wrote:

Hi,

I needed to make a cell to collect all the options chosen in a list as
described in the example DV0017 - Select Multiple Items from Dropdown List of
Debra Dalgleish, which was very helpful. The problem is that I need it to
work for 2 different columns and each of them should collects the options
from different lists. When I tried to apply it for 2 different targets I get
an error. Is there anyone that could help me?

Thank you!