View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Desmond Desmond is offline
external usenet poster
 
Posts: 28
Default GoalSeek, values to formats? help!

I have this example in VB, but could not figure out how to adapt to VBA.

Private Sub SolveFormula()
Me.CustomerAddress1Cell.Formula = "=(A1^3)"
Me.CustomerAddress1Cell.GoalSeek(27, Me.Range("A1"))
End Sub

"JNW" wrote:

Perhaps you could post what you have if you want us to "change" your code.

"Desmond" wrote:

I have written VBA to project cashflows at year end for the next 10 years.
The complete formula is:

Cashflow at year end (t) = (cashflow at year start(t-1) + money coming in
at year start * (1- discount rate(t)))*(1+ interest rate)

I have breaken down to the following columns: Cashflow at year start, Money
in at year start, Discounted money in, Interest, and Cashflow at year end.

Now I set my expected Cashflow at year end, how to change my VBA code to
carry out GoalSeek in order to find how much money should come in each year
given other info unchanged?

Many many thanks!