Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Starting a macro from a list selection
Hello. I've got a worksheet with a column of cells that are set up to select
from a list. What I'd like to do is to be able to execute a macro each time a list item is selected. I've used methods like ".OnEntry" before to start a macro each time a cell is updated, but that function does not seem to be able to sense when a cell containing a list changes the selected list-item. Is there something similar to the .OnEntry but for lists? Thanks so much in advance for the help! Rich |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Starting a macro from a list selection
Hi
You can use the Worksheets Change event For example if the cell in which you have data validation - which shows a list then the following code will print each of the selected values to your Immediate window. You can replace that with the execution of a macro Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells(1).Address = "$A$1" Then Debug.Print Target.Cells(1).Value End If End Sub "Rich_g" wrote: Hello. I've got a worksheet with a column of cells that are set up to select from a list. What I'd like to do is to be able to execute a macro each time a list item is selected. I've used methods like ".OnEntry" before to start a macro each time a cell is updated, but that function does not seem to be able to sense when a cell containing a list changes the selected list-item. Is there something similar to the .OnEntry but for lists? Thanks so much in advance for the help! Rich |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Starting a macro from a list selection
Thanks Alok. I just came across moments ago while searching through a post.
Wish I'd seen it earlier and not foolishly bothered everyone. Anyway, I tried it and it works just great. Thanks again! "Alok" wrote: Hi You can use the Worksheets Change event For example if the cell in which you have data validation - which shows a list then the following code will print each of the selected values to your Immediate window. You can replace that with the execution of a macro Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells(1).Address = "$A$1" Then Debug.Print Target.Cells(1).Value End If End Sub "Rich_g" wrote: Hello. I've got a worksheet with a column of cells that are set up to select from a list. What I'd like to do is to be able to execute a macro each time a list item is selected. I've used methods like ".OnEntry" before to start a macro each time a cell is updated, but that function does not seem to be able to sense when a cell containing a list changes the selected list-item. Is there something similar to the .OnEntry but for lists? Thanks so much in advance for the help! Rich |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Starting a macro from a list selection
You are welcom.
"Rich_g" wrote: Thanks Alok. I just came across moments ago while searching through a post. Wish I'd seen it earlier and not foolishly bothered everyone. Anyway, I tried it and it works just great. Thanks again! "Alok" wrote: Hi You can use the Worksheets Change event For example if the cell in which you have data validation - which shows a list then the following code will print each of the selected values to your Immediate window. You can replace that with the execution of a macro Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells(1).Address = "$A$1" Then Debug.Print Target.Cells(1).Value End If End Sub "Rich_g" wrote: Hello. I've got a worksheet with a column of cells that are set up to select from a list. What I'd like to do is to be able to execute a macro each time a list item is selected. I've used methods like ".OnEntry" before to start a macro each time a cell is updated, but that function does not seem to be able to sense when a cell containing a list changes the selected list-item. Is there something similar to the .OnEntry but for lists? Thanks so much in advance for the help! Rich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to copy or move a row on a particular dropdown list selection | Excel Discussion (Misc queries) | |||
Updating List selection on the fly | Excel Discussion (Misc queries) | |||
validation list - filter based on selection | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Making pick list conditional on selection from previous pick list | Excel Discussion (Misc queries) |