View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default run macro on selection change

right click on the sheet tab and select view code. In the left dropdown
select worksheet. In the right dropdown, select selectionchange

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

End Sub

put your commands there.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error goto ErrHandler
If target.Address = "$A$9" then
Application.EnableEvents = False


End If


ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


"Tony" wrote in message
...
I would like to execute my macro when I will modify data in selected cell.

I
would like to use selection change even as the trigger. How I can do it ?
Thanks for help.

Tony