Goal Seek updating cell value incorrectly

pawanhsharma

Board Regular
Joined
Feb 12, 2013
Messages
64
Hello Everyone,

I am working on a financial file where I want to update a table by doing Goal Seek by changing a cell value. I am using below VBA Code. The code running fine and updating the table properly, also debug.print also showing correct result. however the cell which is suppose to change is showing incorrect value.
my code is

Sub Goal_Seek()
Dim Rrow As Range
With ThisWorkbook.Sheets("Calculation Model")
Set Rrow = .Range("G36:G101").Find(What:=Range("C12").Value, LookIn:=xlValues)
End With
'Do Goal Seek for obtaining
'Debug.Print Rrow.Row
'Debug.Print Range("L" & Rrow.Row).Value
Range("L" & Rrow.Row).GoalSeek Goal:=0, ChangingCell:=Range("C6")
End Sub

I want to update cell C6 value to update desired referance value to 0 (Zero)
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Show what is in C6 before running, what the Debug prints output, what C6 shows after running, what is in the L&Rrow.Row cell after running, and how exactly the macro is "updating the table properly"?
 
Upvote 0
Cell c6 is having a percentage value to calculate interest rates. The lrow and table is calculating repayment schedule. My goal to have value 0 in outstanding against the due payment. When I am running the macro the table is adjusting but the value in desired cell is showing some value in minus.
I will get back to my computer and post the example. Hope that will help. I am not good in these statical and financial formulas ?
 
Upvote 0
What sheets are Range("C12").Value, Range("L" & Rrow.Row) and Range("C6") on? and what sheet is active when the code runs?
 
Upvote 0

Forum statistics

Threads
1,214,845
Messages
6,121,902
Members
449,053
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top