View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Linking to specific cells in pivot table Linking to specific cells in pivot table is offline
external usenet poster
 
Posts: 64
Default 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