staderennais
New Member
- Joined
- Jul 13, 2007
- Messages
- 3
Hi,
I've done some programming but I'm completely new at VBA. I searched the archives but couldn't find a direct example or answer to my question. I apologize if this is a dumb question.
I'm trying to solve a nonlinear equation using goal seek. The output from that equation is then being used in an optimization routine. The point is that I need goalseek to update the row every time before the solver runs another iteration. However, I keep getting this error:
"Run time error '1004' "
Here's my code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim M As Integer
For M = 0 To 99
Worksheets("Sheet1").Range("Offset(j7, M, 0, 1, 1)").GoalSeek _
Goal:=0, _
ChangingCell:=Worksheets("Sheet1").Range("Offset(i7, M, 0, 1, 1)")
Next M
End Sub
Thanks for any help you can offer.
I've done some programming but I'm completely new at VBA. I searched the archives but couldn't find a direct example or answer to my question. I apologize if this is a dumb question.
I'm trying to solve a nonlinear equation using goal seek. The output from that equation is then being used in an optimization routine. The point is that I need goalseek to update the row every time before the solver runs another iteration. However, I keep getting this error:
"Run time error '1004' "
Here's my code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim M As Integer
For M = 0 To 99
Worksheets("Sheet1").Range("Offset(j7, M, 0, 1, 1)").GoalSeek _
Goal:=0, _
ChangingCell:=Worksheets("Sheet1").Range("Offset(i7, M, 0, 1, 1)")
Next M
End Sub
Thanks for any help you can offer.