Hi, I have the following code. It works great, however, if I insert a row so that my table starts on row 2 instead of row 1, I get an error. How do I make it work with my table starting on row 2?
Dim lr As Long, i As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr
Range("Ag" & i).goalseek Goal:=Range("N" & i).Value, ChangingCell:=Range("T" & i)
Range("AY" & i).goalseek Goal:=Range("N" & i).Value, ChangingCell:=Range("AL" & i)
Range("BP" & i).goalseek Goal:=Range("N" & i).Value, ChangingCell:=Range("BC" & i)
Next i
Thanks!
Bookmarks