I'm trying to automate the GoalSeek function over a range of cells. Each cell in Columns I and J calculates a quantity of interest using two different methods, and the results must agree.
Each cell in Column K is the difference between the corresponding cells in Columns I and J. Each cell in Column F contains the value of the parameter that, when GoalSeek converges, drives K to zero (that is, I = J). Here is the code I'm using:
Sub TargetTemp()
Do Until Range("K26:K119") = 0
Range("J26:J119").GoalSeek Goal:=Range("I26:I119"), ChangingCell:=Range("F26:F119")
Loop
End Sub
When I run it I get type mismatch error 13, can't figure out why. Can anyone help?