Hi all, I believe this is probably a fairly easy problem, but I don't know the answer and would appreciate your help. The code below extends GoalSeek for a large number of cells (say, 100,000). But it is dependent on formulas I have in cells G3:W3. More specifically, values in B3 are dependent on G3:W3.
As my spreadsheet will have 100,000 rows or more, I don't want the formulas in G3:W3 to have to be copied into G4:W4, G5:W5, etc. I would prefer the formulas are only in cells G3:W3. But I still want the values in B4, B5, etc. to be dependent on G4:W4, G5:W5, etc.
Can the code below be edited, or can an additional code be created, that would accomplish this objective? I hope I am being clear. I have not provided the actual formulas in G3:W3 for simplicity's sake. If they are needed, please let me know.
As my spreadsheet will have 100,000 rows or more, I don't want the formulas in G3:W3 to have to be copied into G4:W4, G5:W5, etc. I would prefer the formulas are only in cells G3:W3. But I still want the values in B4, B5, etc. to be dependent on G4:W4, G5:W5, etc.
Can the code below be edited, or can an additional code be created, that would accomplish this objective? I hope I am being clear. I have not provided the actual formulas in G3:W3 for simplicity's sake. If they are needed, please let me know.
Code:
Sub ml()
Dim cell As Range
For Each cell In Range("C3", Cells(Rows.Count, "C").End(xlUp))
cell.GoalSeek Goal:=cell.Offset(, -1).Value2, _
ChangingCell:=cell.Offset(, 3)
Next cell
End Sub</pre>