Good day all! I'm trying to make a goal seek function but the change cell target is dynamic based on a certain cell. Hoping to have some help or improvements on the below. Thank you!
Sub GoalSeek()
Dim Answer As Integer
Answer = MsgBox("Run values?", vbYesNo + vbQuestion)
If Answer = vbYes Then
Range("E37").GoalSeek _
Goal:=0, _
ChangingCell:=Range("One cell between I66 - R66 depending on number in cell F5")
ElseIf Answer = vbNo Then
MsgBox "Cancelled", vbExclamation
End If
End Sub
Sub GoalSeek()
Dim Answer As Integer
Answer = MsgBox("Run values?", vbYesNo + vbQuestion)
If Answer = vbYes Then
Range("E37").GoalSeek _
Goal:=0, _
ChangingCell:=Range("One cell between I66 - R66 depending on number in cell F5")
ElseIf Answer = vbNo Then
MsgBox "Cancelled", vbExclamation
End If
End Sub