MrExcel Consulting
Your One Stop for Excel Tips & Solutions

How to run a Macro when cell is clicked on


Posted by Ed on January 03, 2001 11:45 AM

I thought I saw this code in this site but I can not locate it. I need to run a macro when the user clicks on a cell. Any thoughts??

Posted by Dave on January 04, 2001 12:22 AM


Hi Ed

Right click on the sheet name tab and select "View Code" and paste in this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$A$1" Then MsgBox "I'm A1"
End Sub


Dave

OzGrid Business Applications