help with goal seek

S

Stephan

Hi all,
I have been using goal seek to solve for the input value to my equation.
my problem is that I have 100 instances to solve.

column B are the desired values,
column C are the input values.
column D is the result of my calculation applied to the column C values
column E is the difference between B and D.

I've thought I could use a macro to do this,
but it looks to me like macros only accept absolute references.
can anyone help me on how to understand this?

so as not to seem lazy, I have already searched for
an answer to this without success. Maybe I am not using the
correct terminology.

Years ago, when I was using quatro pro, one could put a macro
into a cell and use relative cell assignments for inputs, etc.
then copy the macro cell across and solve multiple input values
quite easily.

Thanks in advance for any help..
Stephan
 
N

Niek Otten

Hi Stephan,

' ===========
Sub Macro1()
Dim i As Long
For i = 1 To 100
Range("D" & i).GoalSeek Goal:=Range("B" & i), ChangingCell:=Range("C" &
i)
Next i
End Sub
' ===========
 
S

Stephan

Hello Niek,

I am very new at macros, so I didn't
understand your answer at first.
a nice basic tutorial later, and all is resolved.

Thank you so much for your guidance!

Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top