I'm a translator trying to track and classify my work project. I want to create a column in which each cell has a list of subject categories (Legal, Business, Education etc) and I want it to be possible to be able to pick multiple subject categories. There are a number of "how to" guides online that give code but I have tried entering it where they tell me to and it's not having the desired effect. I have made the drop down list in one cell already. I just need to apply it to all cells in the same column (to infinity as I will keep adding jobs over the course of my career) and I need it to let me select multiple subject categories (I want to class a supplier contract under both business and legal for example.
I tried using this code ,changing only $C$2 to the box in my spreadsheet already containing the list ($K$2) This didn't work and I'm not sure why (although I have no coding background - I'm just trying to teach myself the basics: Thanks!
Private Sub Worksheet_Change(ByVal Target As Range)
'Code by Sumit Bansal from www.trumpexcel.com
' To Select Multiple Items from a Drop Down List in Excel
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Address = "$C$2" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
Bookmarks