I am new to this site and brand new to VBA. I have a question related to goal seek.
I need to use Goal seek in VBA several times. Here is a sample of my Excel Sheet:
I need to set the cells in F(which is a formula linked to another sheet) to 0, by changing the cells in I (hardcoded). I have the basic code to do this, but I want to figure out how to tell Excel "hey, loop this action for every cell in the column". I don't want to have to manually put this command in VBA hundreds of times. Here is what I actually have in VBA.
Sub Goal_Seek()
'
' Goal_Seek Macro
Range("F7").Select
Range("F7").GoalSeek Goal:=0, ChangingCell:=Range("I7")
Range("F8").Select
Range("F8").GoalSeek Goal:=0, ChangingCell:=Range("I8")
Range("F9").Select
Range("F9").GoalSeek Goal:=0, ChangingCell:=Range("I9")
Range("F10").Select
Range("F10").GoalSeek Goal:=0, ChangingCell:=Range("I10")
Range("F11").Select
Range("F11").GoalSeek Goal:=0, ChangingCell:=Range("I11")
End Sub
Any help is appreciated.
Maybe something like: