I want that in the same cell, I can put one value, and continous insert values and the sum appears in to cells foward.
Code: Select all
Rem Attribute VBA_ModuleType=VBADocumentModule
Option VBASupport 1
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim vRange As Range
If Target.Cells.Count > 4 Then Exit Sub
Set vRange = Range("B12", "L21")
If Not Intersect(Target, vRange) Is Nothing Then
If IsNumeric(Target) And IsNumeric(Target.Offset(0, 2)) Then
Target.Offset(0, 2) = Target + Target.Offset(0, 2) 'pulando uma coluna e inserindo a soma
End If
End If
Set vRange = Nothing
End Sub