Auto execute macro on cell entry

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

Can I make a macro automatically execute when a particular cell assumes the focus by
the actions of a click in the cell, or an enter key moving the focus to that particular cell?

If so, what is the event procedure? And maybe an example would help...

Thanks,
Bernie
 
If you want to preset a value when entering cell C3, try the folowing
worksheet function.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$3" Then
Target.Formula = "Hello world"
End If
End Sub
 
right click the sheet tab>view code>left window select worksheet>right
window select selection change
 
Thank you, Steve...
This works great!

Do you have a link to a site, or the Excel Help menu where I can see a complete list of
the Event Procedures with an explanation of what they do?

Bernie
 

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