Excel Excel VBA Worksheet_Change Syntax

Joined
May 13, 2008
Messages
1
Reaction score
0
Hey,
I am working on a personal finance sheet. Basically, I am goalseeking my final value to zero by changing the payments. However, I would like the sheet to autoupdate for different interest values that i could input. Changing the interest would change the final value, and thus the goalseek would need to happen again. I am trying to do this by using Worksheet_Change and telling it to goalseek inside of it.

So far, my code looks like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$N$9" Then
Range("N48").GoalSeek Goal:=0, ChangingCell:=Range("N11")
End If
End Sub


(where N9 is the location of the interest value that changes, N48 is the final value that will be set to 0, and N11 is the payment value that i would like to be changed by goalseek)
I am very new to vba... so i have no clue if I am doing this remotely correctly

Any help would be great
 

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