Hi All,
I've put the following code together to perform using the goal seek function within a named range called "MarginVariance_Cargo". The goal seek needs to go through 10 to 20 iterations due to roundings which are important to zero. To speed the macro up I was trying to find a way to not perform the goal seek should that row of data have no value in it, however hitting a stumbling block. My code is below, any ideas, much appreciated?
_____________________________________________________________________________________
Dim i As Integer
For i = 1 To 20
For Each marginsolve In Range("MarginVariance_Cargo")
If marginsolve.Offset(, 9).Value > 0 Then
marginsolve.GoalSeek Goal:=0, ChangingCell:=marginsolve.Offset(, 2)
End If
Next marginsolve
Next i
______________________________________________________________________________________
Thank you!
I've put the following code together to perform using the goal seek function within a named range called "MarginVariance_Cargo". The goal seek needs to go through 10 to 20 iterations due to roundings which are important to zero. To speed the macro up I was trying to find a way to not perform the goal seek should that row of data have no value in it, however hitting a stumbling block. My code is below, any ideas, much appreciated?
_____________________________________________________________________________________
Dim i As Integer
For i = 1 To 20
For Each marginsolve In Range("MarginVariance_Cargo")
If marginsolve.Offset(, 9).Value > 0 Then
marginsolve.GoalSeek Goal:=0, ChangingCell:=marginsolve.Offset(, 2)
End If
Next marginsolve
Next i
______________________________________________________________________________________
Thank you!