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.
Bookmarks