How to make a macro so that an Excel Button generates an action?

3

How to give a function to execute a button in excel, the excel button is a drop-down list button, so I want to execute an action, the action I want to give me is that I see a box to complete in which I already have the macro for it, what I do not know is how to do it so that when I give one of the options in my drop-down list the necessary picture appears.

Here would go the Code of the drop-down list button so that when I select an option I enable the corresponding box. + Macro below for box to appear.

Sub Listadesplegable1_AlCambiar()
'
'Section1 Macro
' aparece section 1
'

ActiveWindow.SmallScroll Down:=-72
Range("D2:I11").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=60
Range("D58").Select
ActiveSheet.Paste  
Application.CutCopyMode = False
ActiveWindow.SmallScroll Down:=12
Range("D57").Select

End Sub

This is the function of the first frame and so on it does it with the frames that I want to appear

    
asked by Emmanuel HM 22.02.2017 в 16:44
source

1 answer

1

with a right click on your drop-down list, you give it in Control Format - > Control - > link cell

In this example I am going to link it to cell A1, so when you change your list it will change the value in that cell.

Now you just call the right macro when you change your list

Sub Listadesplegable2_AlCambiar()
   Select Case Range("A1").Value
   Case 1
        Call macro1
   Case 2
        Call macro2
End Sub
    
answered by 23.04.2017 в 00:59