hi, I am struggling to get an offset to work on a goal seek i am trying to do. Essentially i want to goal seek a value in row1, column1 to zero by changing the value of the cell in row 3, column 1. In the next round of calculations, ie when i apply the offset, I want to goalseek row1, column2 to zero by changing the cell in row 3, column 2. Sounds simple but i am doing something wrong. the first calculation works but as soon as i calculate the next column then it breaks down... any ideas...
Code:
Sub MySteppedGoalSeek()
Dim ValueAtPt1 As Range
Dim ValueAtPt2 As Range
Dim counter As Integer
counter = 1
Do
Set ValueAtPt1 = Range("D27").Offset(0, counter)
Set ValueAtPt2 = Range("D31").Offset(0, counter)
ValueAtPt1.GoalSeek goal:=0, changingcell:=ValueAtPt2
counter = counter + 1
Loop Until counter = 10
End Sub