In each sheet, I want to sum column A from A3 downward (there are no empty cells) and insert the sum in the first empty cell.
The code below works fine for sheet1, but the sum value is wrong for sheet2 onward (in sheet2 the sum of sheet1 is doubled and this same value is inserted in sheet3 onward).
I'd be grateful if you could point out what I'm doing wrong, please?
Sub Sum_Dynamic_Rng()
Dim ws As Worksheet
Dim LastCell As Range
For Each ws In ThisWorkbook.Worksheets
Set LastCell = ws.Range("A3").End(xlDown).Offset(1, 0)
LastCell.Formula = WorksheetFunction.Sum(Range(Range("A3"), Range("A3").End(xlDown)))
Next ws
End Sub