Run macro

G

Guest

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
 
B

Bernie Deitrick

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
 
G

Guest

That was simple... thanks!!



Bernie Deitrick said:
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
 

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