ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trigger a Macro (https://www.excelbanter.com/excel-programming/379550-trigger-macro.html)

Patrick Simonds

Trigger a Macro
 
Can you trigger a macro by changing 1 cell?

Specifically if I change Cell Y1 of worksheet January I want
SortModule.FRDSort to run.



Gary Keramidas

Trigger a Macro
 
right click the sheet tab you want it to run on and select view code
paste this and test it out

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Range("Y1")) Is Nothing Then
MsgBox "run code"
End If
End If

End Sub


--


Gary


"Patrick Simonds" wrote in message
...
Can you trigger a macro by changing 1 cell?

Specifically if I change Cell Y1 of worksheet January I want
SortModule.FRDSort to run.





All times are GMT +1. The time now is 09:24 PM.

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