how to activate macro from cell

  • Thread starter Thread starter artzuka
  • Start date Start date
Hi,

You could do this. Right click your sheet tab, view code and paste this in
and then try selecting A1

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

Sub MyMacro()
MsgBox "You Did it"
End Sub

Mike
 
Thanks, It works well...

"Mike H" kirjoitti:
Hi,

You could do this. Right click your sheet tab, view code and paste this in
and then try selecting A1

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

Sub MyMacro()
MsgBox "You Did it"
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top