Goalseek "may not have found a solution"
Hi Dana
Thank you very much. Will give it a try, and if it does not work, will come
back.
Yes, my function does not always have a solution. It is based on the
different values that I supply to it. It is bound to fail for a few.
Mangesh
"Dana DeLouis" wrote in message
...
Here's another option:
Dim Ok As Boolean
Ok = Range("B1").GoalSeek(Goal:=0, ChangingCell:=Range("A1"))
I've never seen that message though. Maybe your function is highly
oscillatory. If so, perhaps as a general idea you can begin with a
different starting value.
You will want to limit the number of loops here though.
Do While Not Ok
[A1] = [A1] + 100 * Rnd - 50
Ok = Range("B1").GoalSeek(Goal:=0, ChangingCell:=Range("A1"))
Loop
Again, just a general idea to try.
Note that a True result (ie Found a solution) is returned if the answer
is
close. Looks like "Close" is around 10^-4.
HTH
--
Dana DeLouis
Win XP & Office 2003
"Mangesh Yadav" wrote in message
...
Hi Tom,
Thanks.
So thats the only way.
Mangesh
"Tom Ogilvy" wrote in message
...
Check if the goal is met.
--
Regards,
Tom Ogilvy
"Mangesh Yadav" wrote in message
...
I am using the goalseek as follows
Range("H5").GoalSeek Goal:=0, ChangingCell:=Range("E5")
Sometimes I don't get a result. Manual running of the goal seek would
give
me: May not have found a solution.
Whereas in VBA I don't get such a warning and the result is dumped in
my
oupput cell. Is there some kind of flag or anything which could tell
me
if
the goal seek has found a solution or not...?
--
- Mangesh
------------------------------------------
Office 2003 & Windows XP
|