You are on page 1of 1

Private Sub Worksheet_Change(ByVal Target As Range)

Dim KeyCells As Range


' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("H3:I3")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
If (WorksheetFunction.CountA(Range("H3:I3")) = 2) Then
Range("J3").Value = Range("H3").Value * Range("I3").Value * 1.5
Else
Range("J3").Value = ""
End If
End If
End Sub

You might also like