Automatic goal seek
Automatic goal seek
(OP)
I have prepared a spreadsheet to calculate psychrometric properties. This requires solving two implicit equations when the inputs are temperature and RH. Presently, I am using goal seek function. Is there a way to activate the goal seek function without manually doing it every time, when the inputs are changed?
I am using goal seek for the following case.
Cell C7 is assume value and cell C8 is calculated value. I am using goal seek in cell F7 (which is C8 minus C7) to Set cell:F7 To value:0 By changing cell:C7
I am using goal seek for the following case.
Cell C7 is assume value and cell C8 is calculated value. I am using goal seek in cell F7 (which is C8 minus C7) to Set cell:F7 To value:0 By changing cell:C7





RE: Automatic goal seek
RE: Automatic goal seek
corus
RE: Automatic goal seek
CODE
Dim bSuccess As Boolean
On Error Resume Next
bSuccess = Range("F7").GoalSeek(0, Range("C7"))
On Error GoTo 0
If Not bSuccess Then
MsgBox "Goal Seek Failed for Cell ""C7""!"
End If
End Sub
-handleman, CSWP (The new, easy test)
RE: Automatic goal seek
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Automatic goal seek
Corus,
Thanks, I did it yesterday after your suggestion, an easy and nice solution. The only problem was that the spreadsheet has two types of inputs with user preference. Providing a command button only to one set of calculations and running the other set automatically didn't look good. Nevertheless, you have an excellent idea for me to use in future.
Greg,
Tried the iteration method but was getting wrong values. Each parameter calculation has more than two if loops (depending upon the valid temperature range) and are implicit. Iteration might have worked but I didn't have enough patience to go through the formulae one by one and removing the circular reference.
Thanks to you all, once again.