I'm trying to write a function that adjusts a parameter using GoalSeek with the "setCell", "changingCell" and "Goal" as input parameters:
However, the above function simply returns "FALSE" and no GoalSeek calculations are performed . When I do the exact same thing with Excel's standard Goal Seek inputbox, it works. I have checked that SetCell.Address, ChangingCell.Address and GoalValue correspond to the input values I use in the standard inputbox.
Any clues on why this doesn't work? Many thanks in advance!
Code:
Function Adjust (SetCell As Range, GoalValue As Double, ChangingCell As Range) As Boolean
Adjust = SetCell.GoalSeek(GoalValue, ChangingCell)
End Function
However, the above function simply returns "FALSE" and no GoalSeek calculations are performed . When I do the exact same thing with Excel's standard Goal Seek inputbox, it works. I have checked that SetCell.Address, ChangingCell.Address and GoalValue correspond to the input values I use in the standard inputbox.
Any clues on why this doesn't work? Many thanks in advance!