VBA Code or Option for Selecting Multiple Options from a Drop Down List

rmrossetti

New Member
Joined
Jan 11, 2016
Messages
30
Hello! Is it possible to have a formula or code that allows for selecting multiple selections from a drop down list that can appear in one cell? Potentially separated by commas? I've seen some folks talk about a VBA code, or a potential list box, but I am not sure where to begin. Attached is my workbook. For instance, on the tab Therapeutic Experience, I would like to be able to select multiple therapeutics into once cell from the range on the data tab. Is there a way to attach a workbook here?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hello rmrossetti, how about concatenating your items in another column, then reference the concatenated column as your drop down list. For example, in column F is Lung Cancer, G is Bone Cancer, H is Nose cancer, etc.. in column AA, concatenate F G H, then use AA as your drop down list. hope this helps. cheers!
 
Upvote 0
I use something like this to comma separate items. Select them one at a time from the list and they'll concatenate. In this list, my data validation fields are in range E2:E500. Adjust that to whatever your sheet needs.

VBA Code:
Private Sub worksheet_change(ByVal Target As Range)
    Dim Oldvalue As String
    Dim Newvalue As String
If Not Intersect(Target, Range("E2:E500")) Is Nothing Then
    Application.EnableEvents = False
      If Target.Value <> "" Then
        Newvalue = Target.Value
        Application.Undo
        Oldvalue = Target.Value
          If Oldvalue = "" Then
            Target.Value = Newvalue
          Else
             If InStr(1, Oldvalue, Newvalue) = 0 Then
                Target.Value = Oldvalue & ", " & Newvalue
             Else
               Target.Value = Oldvalue
             End If
        End If
      End If
      Target.EntireRow.AutoFit
    Application.EnableEvents = True
End If

end sub
 
Upvote 0

Forum statistics

Threads
1,216,763
Messages
6,132,583
Members
449,737
Latest member
naes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top