ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Activation of Macro when Tabbing into a cell (https://www.excelbanter.com/excel-programming/418022-automatic-activation-macro-when-tabbing-into-cell.html)

elisart

Automatic Activation of Macro when Tabbing into a cell
 
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?

JLGWhiz

Automatic Activation of Macro when Tabbing into a cell
 
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.

"elisart" wrote:

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?


elisart

Automatic Activation of Macro when Tabbing into a cell
 
Beautiful! Thanks.

"JLGWhiz" wrote:

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.

"elisart" wrote:

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?



All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com