У меня есть код, который дает мне сумму значений из строк A - J, но он добавляет только значения из строки 1 - 2. Я пытаюсь получить его для суммирования значений из строки 1 - 10.
Sub addcol()
Dim i As Long, j As Long
Dim lastRow As Long
lastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlPrevious, _
MatchCase:=False).Row
Dim LastColumn As Long
LastColumn = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
For j = 1 To lastRow
For i = 1 To LastColumn
Cells(lastRow + 1, i) = Cells(lastRow + 1, i) + Application.WorksheetFunction.Sum(Cells(j, i))
Next i
Next j
End Sub