Hey guys. I need help for the following. I am SURE there is a faster code but I am new to coding and do not really know the commands for what I need to do. Below is the coding that I have now.
___________________________________________________________
Sub Solver()
'
' Solver Macro
'
'
Range("F20").Select
Range("F20").GoalSeek Goal:=0, ChangingCell:=Range("B7")
Range("F21").Select
Range("F21").GoalSeek Goal:=0, ChangingCell:=Range("G21")
Range("F22").Select
Range("F22").GoalSeek Goal:=0, ChangingCell:=Range("G22")
Range("F23").Select
Range("F23").GoalSeek Goal:=0, ChangingCell:=Range("G23")
Range("F24").Select
Range("F24").GoalSeek Goal:=0, ChangingCell:=Range("G24")
Range("F25").Select
Range("F25").GoalSeek Goal:=0, ChangingCell:=Range("G25")
End Sub
___________________________________________________________________
As you can see, I am using the same code over and over again, I'm just going one row down each time. I need to go all the way to 500 and dont want to copy and paste and change the row number. Someone Please HELP ME!
Thanks!!!
___________________________________________________________
Sub Solver()
'
' Solver Macro
'
'
Range("F20").Select
Range("F20").GoalSeek Goal:=0, ChangingCell:=Range("B7")
Range("F21").Select
Range("F21").GoalSeek Goal:=0, ChangingCell:=Range("G21")
Range("F22").Select
Range("F22").GoalSeek Goal:=0, ChangingCell:=Range("G22")
Range("F23").Select
Range("F23").GoalSeek Goal:=0, ChangingCell:=Range("G23")
Range("F24").Select
Range("F24").GoalSeek Goal:=0, ChangingCell:=Range("G24")
Range("F25").Select
Range("F25").GoalSeek Goal:=0, ChangingCell:=Range("G25")
End Sub
___________________________________________________________________
As you can see, I am using the same code over and over again, I'm just going one row down each time. I need to go all the way to 500 and dont want to copy and paste and change the row number. Someone Please HELP ME!
Thanks!!!