Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default Macro help for goal seek

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default Macro help for goal seek

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


"Dean" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default Macro help for goal seek

Thank you, that did it. I figured the rest out myself!

"bpeltzer" wrote in message
...
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


"Dean" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goal seek via macro? Ken G. Excel Discussion (Misc queries) 2 April 3rd 09 09:48 AM
Goal Seek in a Macro mrogge2895 Excel Discussion (Misc queries) 1 November 20th 08 11:37 PM
Goal Seek tool in a macro choboy Excel Discussion (Misc queries) 0 April 27th 05 09:22 AM
Goal Seek macro Jeff Excel Programming 1 October 12th 04 09:23 PM
Simple goal seek macro Elijah Excel Programming 0 August 26th 03 01:45 AM


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"