Creating a Dependent Drop Down List from Multiple Data (Multiple Select using VBA) in One Cell

%3CLINGO-SUB%20id%3D%22lingo-sub-2830964%22%20slang%3D%22en-US%22%3ECreating%20a%20Dependent%20Drop%20Down%20List%20from%20Multiple%20Data%20(Multiple%20Select%20using%20VBA)%20in%20One%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2830964%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20create%20a%20second%20dependent%20drop%20down%20list%20but%20the%20data%20I%20want%20it%20to%20be%20dependent%20on%20as%20multiple%20data%20value%20in%20a%20cell%20which%20is%20inserted%20from%20a%20drop%20down%20list.%20I%20have%20used%20VBA%20code%20to%20make%20it%20a%20multi-select%20drop%20down%20so%20multiple%20data%20can%20be%20selected%20in%20the%20cell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20data%20in%20the%20first%20drop%20down%20are%20technology%20areas%20and%20the%20second%20drop%20down%20i'm%20trying%20to%20create%20is%20the%20individual%20technology%20components%20within%20the%20area.%20How%20can%20I%20create%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2830964%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2831062%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20Dependent%20Drop%20Down%20List%20from%20Multiple%20Data%20(Multiple%20Select%20using%20VBA)%20in%20One%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2831062%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1181044%22%20target%3D%22_blank%22%3E%40OzzieKhawaja%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESee%20the%20attached%20version.%3C%2FP%3E%0A%3CP%3EPlease%20test%20thoroughly.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2831184%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20Dependent%20Drop%20Down%20List%20from%20Multiple%20Data%20(Multiple%20Select%20using%20VBA)%20in%20One%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2831184%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1181044%22%20target%3D%22_blank%22%3E%40OzzieKhawaja%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%2C%20but%20the%20implementation%20depends%20on%20what%20exactly%20you%20want%20to%20do.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi Community,

 

I'm trying to create a second dependent drop down list but the data I want it to be dependent on as multiple data value in a cell which is inserted from a drop down list. I have used VBA code to make it a multi-select drop down so multiple data can be selected in the cell. This can be seen on the attachment under the Technology Area Column, you can select multiple areas. The second column i'm trying to create is under the Portfolio column. I've created the data set under Sheet 2.

 

The data in the first drop down are technology areas and the second drop down i'm trying to create is the individual technology components within the area. How can I create this?

 

Thanks

9 Replies

@OzzieKhawaja 

See the attached version.

Please test thoroughly.

@Hans Vogelaar you are a legend. Thank you so much. Can I apply conditional formatting to this?

@OzzieKhawaja 

Yes, but the implementation depends on what exactly you want to do.

Ok so now want I want is that for each technology area that is selected appears in a different colour and then the different portfolio areas appears in the same colour as the technology area.

@OzzieKhawaja 

So you want different colors within the same cell. That is not possible using conditional formatting, for that is always applied to an entire cell. It would require VBA. It would be complicated, I'll see if I can come up with something. I don't have time for that immediately.

Thats fine, no problem. Whenever you can would be great.
Hi Hans, how do use your colour formula to the columns I want to apply them to?

@OzzieKhawaja 

Right-click the sheet tab and select View Code from the context menu to see the code.

The Worksheet_Change event procedure calls the UpdateValue procedure when a the user modifies a cell in B4:B50 or C4:C50, and this in its turn calls the UpdateFormat procedure.

UpdateFormat looks at the source range of the data validation dropdown for the cell, and colors each entry according to its position.

If you want to apply this to more columns, you'd have to expand both the Worksheet_Change and the UpdateFormat procedures.