Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I trigger a macro by selecting from a dropdown list?
I have a validation list set up as well as a macro related to the information
in that list. I want to be able to select something from the list and have a macro automatically run. Currently, I have a separate button that I have to push that runs the macro, but I want to eliminate this step. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I trigger a macro by selecting from a dropdown list?
You want to trigger the change event something like this...
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "Call your macro" End If End Sub Change the $A$1 to the cell address of the cell with your validation list... -- HTH... Jim Thomlinson "Modell" wrote: I have a validation list set up as well as a macro related to the information in that list. I want to be able to select something from the list and have a macro automatically run. Currently, I have a separate button that I have to push that runs the macro, but I want to eliminate this step. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I trigger a macro by selecting from a dropdown list?
Jim,
2 questions: 1. Do I replace the "Worksheet_Change(ByVal Target As Range)" with the name of the worksheet in my spreadsheet? 2. Do I replace "Call your macro" with the name of the macro I want to automatically run? Thanks for your help. "Jim Thomlinson" wrote: You want to trigger the change event something like this... Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "Call your macro" End If End Sub Change the $A$1 to the cell address of the cell with your validation list... -- HTH... Jim Thomlinson "Modell" wrote: I have a validation list set up as well as a macro related to the information in that list. I want to be able to select something from the list and have a macro automatically run. Currently, I have a separate button that I have to push that runs the macro, but I want to eliminate this step. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I trigger a macro by selecting from a dropdown list?
Jim,
I got it to work. Thanks for your help! "Modell" wrote: Jim, 2 questions: 1. Do I replace the "Worksheet_Change(ByVal Target As Range)" with the name of the worksheet in my spreadsheet? 2. Do I replace "Call your macro" with the name of the macro I want to automatically run? Thanks for your help. "Jim Thomlinson" wrote: You want to trigger the change event something like this... Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "Call your macro" End If End Sub Change the $A$1 to the cell address of the cell with your validation list... -- HTH... Jim Thomlinson "Modell" wrote: I have a validation list set up as well as a macro related to the information in that list. I want to be able to select something from the list and have a macro automatically run. Currently, I have a separate button that I have to push that runs the macro, but I want to eliminate this step. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I get one dropdown menu to trigger another one in excel | Excel Discussion (Misc queries) | |||
Running Macros by selecting from a dropdown list | Excel Discussion (Misc queries) | |||
result of selecting from the dropdown list should be a dropdown list | Excel Worksheet Functions | |||
result of selecting from the dropdown list should be a dropdown list | Excel Worksheet Functions | |||
dropdown list to activate Macro | Excel Programming |