I need to put the result of the sum at the end of the last column on different sheets (Not the same number of columns and number of rows)
I need to fix the last part of the code to let that happen.
this is the code (I marked in the code what does not work):
Sub Sum_Dynamic_Rng()
Dim ws As Worksheet
Dim LastCell As Range
Dim ColumnNumber As Long
Dim ColumnLetter As String
ColumnNumber = Range("S3").End(xlToLeft).Column
ColumnLetter = Split(Cells(1, ColumnNumber).Address, "$")(1)
For Each ws In ThisWorkbook.Worksheets
Set LastCell = ws.Range(ColumnLetter & 2).End(xlDown).Offset(1, 0)
**LastCell = WorksheetFunction.Sum(ws.Range(ws.Range(ColumnLetter & 2), ws.Range(ColumnLetter & 2).End(xlDown)))**
Next ws
End Sub