rwilliams09
New Member
- Joined
- Jun 18, 2017
- Messages
- 48
I am trying to run a breakeven analysis using a Goal Seek. The Goal Seek looks at the NPV, and should put in a new price to change the NPV to 0. However, I would like for the NPV cell to retain the formula rather than change to the hard-coded number 0 every time I run it.
Is there something that can fix this? My code is the following:
Is there something that can fix this? My code is the following:
Code:
Private Sub CommandButton2_Click()If Range("Q9").Value = 2 Then
Application.ScreenUpdating = False
With Range("Q11")
.GoalSeek Goal:=0, ChangingCell:=Range("P22")
.Value = Application.Max(0, .Value)
End With
Application.ScreenUpdating = True
End If
End Sub
Last edited: