is it possibke to run a macro when a cell in a range is cliked on


Posted by patrick on July 15, 2001 6:40 AM

Hi,
is it possibke to run a macro when
a cell in a range
is cliked on ?

Thanks



Posted by Ivan F Moala on July 15, 2001 7:24 PM

Yes, using the sheets events eg.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$3" Then
RunMyMacro
End If
End Sub

would run a macro Named RunMyMacro.
Place above code in the sheets code module
Right click on the sheet tab you want the cell
to be clicked and select view code...then add this
code.


Ivan