Hi, guys
I able to get the total value at B8, but when come to create the next column, D8 doesn't appear the total value.
Below are my code. Anyone able to help me? Thank in advance.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Static A, C As Double
If Target.Address = "$A$8" Then
A = Range("B8").Value
Range("B8").Value = A + Target.Value
If Target.Address = "$C$8" Then
C = Range("D8").Value
Range("D8").Value = C + Target.Value
End If
End If
End Sub
I able to get the total value at B8, but when come to create the next column, D8 doesn't appear the total value.
Below are my code. Anyone able to help me? Thank in advance.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Static A, C As Double
If Target.Address = "$A$8" Then
A = Range("B8").Value
Range("B8").Value = A + Target.Value
If Target.Address = "$C$8" Then
C = Range("D8").Value
Range("D8").Value = C + Target.Value
End If
End If
End Sub