an idea project is to input numeric (such as 0,1, 4.5, 123.75, -2) in each cell (sheet1!d3:ac22)
and want to sent each input data cell (sheet1!d3:ac22) for accumulate in the sheet2 (sheet2!d3:ac22)
with the same table
my starting code are below...
there are a number of text that i have to put with these vba code for run vba
how to rewrite the below code in short with using code For... Next?
your kindly advise is need. Thank you
and want to sent each input data cell (sheet1!d3:ac22) for accumulate in the sheet2 (sheet2!d3:ac22)
with the same table
my starting code are below...
Rich (BB code):
Private Sub Worksheet_Change(ByVal target As Range)
Set d3sumrange = Range("d3")
bd3currentval = Range("Bd3").Value
If Not Intersect(target, [d3]) Is Nothing Then
Range("Bd3").Value = Application.WorksheetFunction.Sum(bd3currentval, d3sumrange)
End If
End Sub
there are a number of text that i have to put with these vba code for run vba
how to rewrite the below code in short with using code For... Next?
Rich (BB code):
Private Sub Worksheet_Change(ByVal target As Range)
Set d3sumrange = Range("d3")
Set d4sumrange = Range("d4")
Set d5sumrange = Range("d5")
...till Set ac22sumrange = Range("ac22")
bd3currentval = Range("Bd3").Value
bd4currentval = Range("Bd4").Value
bd5currentval = Range("Bd5").Value
...til bd22currentval = Range("Bd22").Value
If Not Intersect(target, [d3]) Is Nothing Then
Range("Bd3").Value = Application.WorksheetFunction.Sum(bd3currentval, d3sumrange)
End If
If Not Intersect(target, [d4]) Is Nothing Then
Range("Bd4").Value = Application.WorksheetFunction.Sum(bd4currentval, d4sumrange)
End If
If Not Intersect(target, [d5]) Is Nothing Then
Range("Bd5").Value = Application.WorksheetFunction.Sum(bd5currentval, d5sumrange)
End If
...till If Not Intersect(target, [cc22]) Is Nothing Then Range("cc22").Value = Application.WorksheetFunction.Sum(cc22currentval, cc22sumrange)
End If
End Sub
your kindly advise is need. Thank you