Macro help for goal seek

D

Dean

I would like to create a macro that, if you first place the cursor in the right cell, invokes tools, goal seek (which has three boxes to be filled in) on that cell (that cell is, by default, what's placed in the first goal seek box, so that part is done), then fills the 2nd box within goal seek with the VALUE produced by a formula in the next cell to the right, then for the third box, uses the cell that is 4 cells to the left.

At the outset, I would like it to first ask how many iterations I want and, if it's 5, after it's done what I just said would start again, 12 cells down from where the prior iteration of goal seek started. Then it would stop.

The part that seems to be a problem for me is telling it how to take the value of that cell formula to the right and type that into the 2nd goal seek box. Can anyone kindly help me with that part, if not the entire macro.

Thanks!
Dean
 
B

bpeltzer

Change the Goal assignment in the GoalSeek method from a constant to a cell
value. For instance, change from
Range("C9").GoalSeek Goal:=12, ChangingCell:=Range("C7")
to
Range("C9").GoalSeek Goal:=Range("D10").Value, ChangingCell:=Range("C7")
where the goal is now based on the result in D10, instead of fixed at 12.
--Bruce
 

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