Easy deploying in your enterprise or organization.
And then save and close this code window, now, when you select the Insert Blank rows item from the drop down list, Macro1 will be triggered, and so on… Note: In the above code, E1 is the cell contains the drop down list, change the macro names and drop down list values to your needed.ģ. If Not Intersect(Target, Range("E1")) Is Nothing Then Step 2: Now select any cell where you want to create the drop-down list for the courses. VBA code: Run macro based on value selected from drop down list: Private Sub Worksheet_Change(ByVal Target As Range) Follow the below steps to implement a dynamic chart linked with a drop-down menu in Excel: Step 1: Insert the data set into an Excel sheet in the cells as shown above. Then right click the sheet tab contains the drop down you want to use, and then choose View Code from the context menu, and in the opened Microsoft Visual Basic for applications window, copy and paste the following code into the blank Module: Firstly, create a drop down list as you need, see screenshot:Ģ. There is no direct way to finish this task, but, the following VBA code can help you, please do as this:ġ. Run macro based on value selected from drop down list with VBA code This article will introduce a useful code for you to solving this job. To run macros by clicking command button is a common task in Excel, but, have you ever tried to execute the macro codes based on the value which is selected from drop down list? It means, when you choose one item from the drop down list, the specific macro will be triggered at once. How to run macro based on value selected from drop down list in Excel?