Private Sub Worksheet_Change(ByVal Target As Range)
Dim lg1&, lg2&, v1%, v2%
With Target
If .CountLarge > 1 Then Exit Sub
If .Column <> 3 Then Exit Sub
lg2 = .Row: If lg2 < 4 Then Exit Sub
v2 = .Value: If v2 = 0 Then .Offset(, 1).ClearContents: Exit Sub
If lg2 = 4 Then
v1 = v2
Else
lg1 = lg2: Do While Cells(lg1 - 1, 3) = 0: lg1 = lg1 - 1: Loop
v1 = Val(Replace$(Cells(lg1 - 1, 3), ",", "."))
End If
If v2 = 0 Then .Offset(, 1) = "" Else .Offset(, 1) = v1 - v2
End With
End Sub