Automatic Activation of Macro when Tabbing into a cell

E

elisart

I would like to create a form for our company that will cause a calendar
macro to automatically run when ever the appropriate cell(s) are activated by
tabbing or mouse click? I already have the calender macro. Just need to run
it when the cell activates. Any ideas?
 
J

JLGWhiz

Put this macro in the worksheet code module of the sheet
with the magic cell on it.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("B5").Address Then
popUp
End If
End Sub

Put this macro in the standard Module1.


Sub popUp()
MsgBox "It works"
End Sub



When you select cell B5 the macro in the standard module will
run and display the message box. You can adapt this to suit
your needs.
 
E

elisart

Beautiful! Thanks.

JLGWhiz said:
Put this macro in the worksheet code module of the sheet
with the magic cell on it.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("B5").Address Then
popUp
End If
End Sub

Put this macro in the standard Module1.


Sub popUp()
MsgBox "It works"
End Sub



When you select cell B5 the macro in the standard module will
run and display the message box. You can adapt this to suit
your needs.
 

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

Top