Hi Excel Guru's
I have found the following code on the forum, it allows multiple selection from a drop down list, separating the items with a comma, in a single cell
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRng As Range
Dim xValue1 As String
Dim xValue2 As String
If Target.Count > 1 Then Exit Sub
On Error Resume Next
Set xRng = Range("R:R").SpecialCells(xlCellTypeAllValidation)
If xRng Is Nothing Then Exit Sub
Application.EnableEvents = False
If Not Application.Intersect(Target, xRng) Is Nothing Then
xValue2 = Target.Value
Application.Undo
xValue1 = Target.Value
Target.Value = xValue2
If xValue1 <> "" Then
If xValue2 <> "" Then
Target.Value = xValue1 & ", " & xValue2
End If
End If
End If
Application.EnableEvents = True
End Sub
This code works ok
However, my sheet is protected, and once protected the above code does not work
I have seen some comments saying the function "xlCellTypeAllValidation" will not work on a protected sheet, but have not had any luck in finding a workaround
Hope you can help
Thanks in advance for any replies
Simon.xlsx
Bookmarks