ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run macro (https://www.excelbanter.com/excel-discussion-misc-queries/110986-run-macro.html)

Ed

Run macro
 
Hello I have the following macro:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$9" Then
Call Calculation
End If
End Sub


How do I set it up to run the macro "Calculation" after I changed the value
in D9 rather than when I select cell D9?

thanks

Bernie Deitrick

Run macro
 
Ed,

Use the change event:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$9" Then
Call Calculation
End If
End Sub

HTH,
Bernie
MS Excel MVP


"Ed" wrote in message
...
Hello I have the following macro:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$9" Then
Call Calculation
End If
End Sub


How do I set it up to run the macro "Calculation" after I changed the value
in D9 rather than when I select cell D9?

thanks




Ed

Run macro
 
That was simple... thanks!!



"Bernie Deitrick" wrote:

Ed,

Use the change event:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$9" Then
Call Calculation
End If
End Sub

HTH,
Bernie
MS Excel MVP


"Ed" wrote in message
...
Hello I have the following macro:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$9" Then
Call Calculation
End If
End Sub


How do I set it up to run the macro "Calculation" after I changed the value
in D9 rather than when I select cell D9?

thanks






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

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