G
Guest
Hi all,
Is there a way to modify this code so that it applies to all rows instead of
just the indicated rows? For example....adding a value in D3 will be added to
F3...values added in D10 will be added to F10...and so on....in other words,
I'd like it to apply to the entire columns.
Thanks!
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = ("D3") Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("F3").Value = Range("F3").Value + .Value
Application.EnableEvents = True
End If
End If
End With
With Target
If .Address(False, False) = "C3" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("F3").Value = Range("F3").Value - .Value
Application.EnableEvents = True
End If
End If
End With
End Sub
Is there a way to modify this code so that it applies to all rows instead of
just the indicated rows? For example....adding a value in D3 will be added to
F3...values added in D10 will be added to F10...and so on....in other words,
I'd like it to apply to the entire columns.
Thanks!
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = ("D3") Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("F3").Value = Range("F3").Value + .Value
Application.EnableEvents = True
End If
End If
End With
With Target
If .Address(False, False) = "C3" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("F3").Value = Range("F3").Value - .Value
Application.EnableEvents = True
End If
End If
End With
End Sub