MrExcel Publishing
Your One Stop for Excel Tips & Solutions

assigning a macro

Posted by John on January 14, 2002 5:21 AM

How do I assign a macro to a cell so that it works on selection or double click?



Posted by Mamillius on January 14, 2002 6:20 AM

Put something like this in the worksheet code module :-

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