SOLVED

Add a cell with text according to a list of choices - VBA

Brass Contributor

Hi everyone, don't know where to start this kind of macro. But I have 3 lists that if I selected one from the lists, it will then populate certain text in a cell. Say for example on the attached file. 

 

rbalza_0-1627183399497.png

 

7 Replies
Is it a complete file? Where are the ingredients lists which you want to populate based on the selection?

@rbalza 

 

It wouldn't have to involve macros or VBA routines. This can be done with what I've called a cascading set of Data Validation steps. I've attached an example that works with first and last names, but the same logic could apply to sets of ingredients based on a first selection of the dish to prepare.

 

Note: these functions do require the most recent version of Excel. Here's a YouTube video that explains the Dynamic Array functions. https://www.youtube.com/watch?v=9I9DtFOVPIg

 

Learn everything about our brand-new Dynamic Arrays and how you can use them to build advanced spreadsheets. Arrays (CSE) have long been present in Excel, but were limited to power users. With Dynamic Arrays we have rebuilt the calc engine, effectively turning all formulas into array formulas ...

@Subodh_Tiwari_sktneer please find the attached file. Thanks in advance :)

@mathetes thanks for taking the time on this. will look on the link/sheet that you have provided. Cheers!

@rbalza 

Please find a simple setup with three named ranges called "Apple_Pie", "Custard_Pie" and "All_Pies" on the List Sheet then you may select an item from the dropdown in B1 to populate the list of corresponding ingredients. See if this is what you were trying to achieve.

The Code is placed on Sheet1 Module for Sheet_Change Event.

 

 

 

 

@Subodh_Tiwari_sktneer 

 

Hi, appreciate the time you are taking out on this. Is there a way to make it like a clickable cell rather than a drop-down list?

best response confirmed by rbalza (Brass Contributor)
Solution

@rbalza 

Okay, please find the attached and once you select any cell in the range B1:D1, the corresponding ingredients list will be populated.

 

1 best response

Accepted Solutions
best response confirmed by rbalza (Brass Contributor)
Solution

@rbalza 

Okay, please find the attached and once you select any cell in the range B1:D1, the corresponding ingredients list will be populated.

 

View solution in original post