How do I start a VBA procedure when selecting a cell????


Posted by John Owens on January 28, 2002 1:01 PM

I want to start a VBA procedure when an user select a cell either by pressing the TAB key or point and click.

Anyone have any ideas.

Thanks.



Posted by Juan Pablo G. on January 28, 2002 1:30 PM

This goes in the sheet module. It will run "MyMacro" when the user selects A1

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$A$1" Then MyMacro
End Sub

Juan Pablo G.