I'm having difficulty integrating two nearly-identical codes into one with Visual Basic Editor. Here is the coding that is leading me to trouble.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row = 51 And Target.Column = 4 _
Then
Range("H47").GoalSeek Goal:=Range("D51").Value, _
ChangingCell:=Range("D37")
End If
If Target.Row = 52 And Target.Column = 4 _
Then
Range("H50").GoalSeek Goal:=Range("D5").Value, _
ChangingCell:=Range("D42")
End If
End Sub
Any guidance is much appreciated!
Bookmarks