0

Please how can find the Total Payment for each of the rows dynamically till the last non-empty row using Excel macro?

That is storing the sum of Cell ("B2", "C2", 'D2") in Cell("E2), the same with next row till the end non-empty row. See the above sheet.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • How to find the last column (with data) has been answered here: https://stackoverflow.com/q/11926972/19529102 - once you have the last column for a row it should be pretty straight forward from there: you could for example use `Application.WorksheetFunction.Sum()` – Lord-JulianXLII May 14 '23 at 20:48

1 Answers1

0

Sorry, but i can't see any sheet here. Still i tried check this Macro if it works for you.

Sub Sum_Total_LastNONemptycell()

Dim i As Integer

For i = 2 To Range("b1000000").End(xlUp).Row
    Range("E" & i).Value = WorksheetFunction.Sum(Range("B" & i).Value, Range("C" & i).Value, Range("D" & i).Value)
Next i

End Sub

Ryuk
  • 16