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


Hi, my intent is to perform goal seek for each row (_twice_) from row 19
to 27 as follow. Somehow the goal seek below row 19 cannot be
"activated" unless the value in the "most upper right cell", in this
case Range("BA19") is targeted. I don't quite see the logic. I was
thinking about using "for each ... in ..." but didn't know how to set
the group as rows?

Method 1:
For i = 19 To 27
Cells(i, "AE").GoalSeek Goal:=Cells(i, "AD"), ChangingCell:=Cells(i,
"AF")
Cells(i, "AZ").GoalSeek Goal:=Cells(i, "O"), ChangingCell:=Cells(i,
"BA")
Next i

Method 1: If row 19 is targeted, then goal seek from 19 to 27 will be
activated. However, if row below 19 is targeted, no goal seek because
the count has to start from row 19?


Method 2:
Range("AE19").GoalSeek Goal:=Range("AD19"),
ChangingCell:=Range("AF19")
.......
Range("AE27").GoalSeek Goal:=Range("AD27"),
ChangingCell:=Range("AF27")

Range("AZ19").GoalSeek Goal:=Range("O19"), ChangingCell:=Range("BA19")
......
Range("AZ27").GoalSeek Goal:=Range("O27"), ChangingCell:=Range("BA27")

Method 2: Goal seek only activates for "AF", no goal seek for "BA"
because row 19 through 27 has already been passed once on
worksheet_calculate()? I guess it's a looping problem.

Thanks for your input.


--
csw78
------------------------------------------------------------------------
csw78's Profile: http://www.excelforum.com/member.php...o&userid=23008
View this thread: http://www.excelforum.com/showthread...hreadid=378345

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba goal seek 2


Please ignore the post. The following seems to work fine, didn't know
why it wasn't working yesterday. I might have missed a couple of inputs
within the row or the goal seek just wasn't converging. Thanks all!

Method 1:
For i = 19 To 27
Cells(i, "AE").GoalSeek Goal:=Cells(i, "AD"), ChangingCell:=Cells(i,
"AF")
Cells(i, "AZ").GoalSeek Goal:=Cells(i, "O"), ChangingCell:=Cells(i,
"BA")
Next i


--
csw78
------------------------------------------------------------------------
csw78's Profile: http://www.excelforum.com/member.php...o&userid=23008
View this thread: http://www.excelforum.com/showthread...hreadid=378345

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
How to use goal seek manu Excel Worksheet Functions 2 July 8th 07 11:10 PM
goal seek tikchye_oldLearner57 Excel Discussion (Misc queries) 3 August 31st 06 02:52 PM
Goal Seek Jake Excel Discussion (Misc queries) 1 June 12th 05 05:55 AM
Goal Seek Tiya Excel Worksheet Functions 1 May 11th 05 12:38 PM
Goal Seek (in VBA) Tushar Mehta[_6_] Excel Programming 1 August 18th 03 04:18 AM


All times are GMT +1. The time now is 12:39 PM.

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

About Us

"It's about Microsoft Excel"