MrExcel Publishing
Your One Stop for Excel Tips & Solutions

goal seek help


Posted by gart on December 21, 2001 7:04 PM


What I need with this code
([C3].GoalSeek Goal:=0, ChangingCell:=[E3])is instead of only adjusting one cell by making one cell with the formula zero, I need the whole column to do it. Make sense? for example instead of only c3 with the formula but c3:c22 and then adjust not only e3 but e3:e22

Thanks


Posted by Ivan F Moala on December 21, 2001 11:02 PM

Try

Sub Goalseek_Do()
Dim GoalRg As Range
Dim ocell As Range

Set GoalRg = [C3:C22]
For Each ocell In GoalRg
ocell.GoalSeek 0, ocell.Offset(0, 2)
Next
End Sub


Ivan