View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Macro that runs when a cell is selected

This runs when A1 is selected. Right click the sheet tab and select view
code. Paste the following...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
MsgBox "Tada"
End If
End Sub
--
HTH...

Jim Thomlinson


"Daniel Bonallack" wrote:

I have a macro that I want to run when the user selects a cell. Can someone
give me the code that would do this?

Thanks in advance!

Daniel