Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can a macro be triggered when a cell is selected?
Hi,
I'm trying to have a macro executed when a specific cell in the spreadsheet is selected. Is there a way to do this? What would the code look like? Thanks for your help!! Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can a macro be triggered when a cell is selected?
You can use the worksheet selection change event to do this. Right click on
the sheet tab and select view code. Paste this macro onto the code sheet and change as required to run specific code or call another macro. PS change the cell reference to whatever is appropriate - currently set to A10. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$10" Then MsgBox "Your macro here" End If End Sub Hope this helps Rowan "Linking to specific cells in pivot table" wrote: Hi, I'm trying to have a macro executed when a specific cell in the spreadsheet is selected. Is there a way to do this? What would the code look like? Thanks for your help!! Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can a macro be triggered when a cell is selected?
Thanks Rowan!!
"Rowan" wrote: You can use the worksheet selection change event to do this. Right click on the sheet tab and select view code. Paste this macro onto the code sheet and change as required to run specific code or call another macro. PS change the cell reference to whatever is appropriate - currently set to A10. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$10" Then MsgBox "Your macro here" End If End Sub Hope this helps Rowan "Linking to specific cells in pivot table" wrote: Hi, I'm trying to have a macro executed when a specific cell in the spreadsheet is selected. Is there a way to do this? What would the code look like? Thanks for your help!! Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for a one time triggered copy of cell value | Excel Discussion (Misc queries) | |||
Macro to transfer contents of 'Selected' cell to alternate cell. | Excel Worksheet Functions | |||
run macro when cell is selected | Excel Worksheet Functions | |||
Macro triggered by an event | Excel Discussion (Misc queries) | |||
macro triggered by a change to a cell | Excel Programming |