Forum

More than one colum...
 
Notifications
Clear all

More than one column with dropdown list multiple selections

2 Posts
2 Users
0 Reactions
91 Views
(@jmcmurdie)
Posts: 1
New Member
Topic starter
 

I have use the VBA code in the "Select Multiple Items in an Excel Drop Down List" and this works fine for one column (dv_interventions) see below, however I have other colums on the same sheet that I would like the same function, how do I do this?

If Not Intersect(Target, ActiveSheet.Range("dv_interventions")) Is Nothing Then

I have named these ranges "dv_output" and "dv_outcome". I tried adding them to the above line. It worked when I added one, either of then, but not when I added both ranges as below

If Not Intersect(Target, ActiveSheet.Range("dv_interventions", "dv_output", "dv_outcome")) Is Nothing Then

Help please

 
Posted : 03/02/2023 6:29 am
(@keebellah)
Posts: 373
Reputable Member
 

Hi, in these case you have to use UNION to address multiple ranges.

If Not Intersect(Target, UNION(Range("dv_interventions"), Range("dv_output"), range("dv_outcome")))) Is Nothing Then

Then if there is something specific for each ragne you use the intersect for each range again:

If Not Intersect(Target, Range("dv_interventions")) Then

ElseIf Not Intersect(Target, Range("dv_interventions")) Is Nothing Then

ElseIf Not Intersect(Target, Range("dv_interventions")) Is Nothing Then

End If

 
Posted : 04/02/2023 2:55 am
Share: