View Single Post
  #2   Report Post  
Bernard Liengme
 
Posts: n/a
Default

Why you should want to do this I cannot guess!
In column A (say A2:A22) enter the required x-values
In B (B2:B22) enter any y-values --- a series of 1's will do
In C2 enter =A2+B2 and copy down to C22
Open Solver, clear the Target box; the By changing should read B2:B22; add
constraint C2:C22=0; solve
Plot A2:B22
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Ali Baba" wrote in message
...
Hi

I would like to plot a formula in this form
x + y = 0

I know u may say "rearrange it to y = -x" and plot it. This is not what I
want.

I tried to write a code to generate data on the worksheet but I was
unseccusseful

this is what I am trying to do

for x values,
y = -10
For x = 1 to 10
Cells(i,1) = x
Function = replace(function, "x", x)

Do
function = evaluate(replace(function, "y", y))
y = y + 0.1
loop until function = 0
Cells(i,2) = y-0.1

Next x

Can anybody help to write this code??