masters,
I have a error in the following code . run time error 438 "Object Does not Support this property or method." yellow debugger stops at Ln 34
can you please tell me what is wrong here?
I have a error in the following code . run time error 438 "Object Does not Support this property or method." yellow debugger stops at Ln 34
can you please tell me what is wrong here?
Code:
Sub SumRowsColumns30Sheet()
Dim LastRow As Long
Dim iRow As Long
Dim iCol As Integer
Dim nSheets As Integer '/ This is the variable I used to try to calculate across 3 sheets.
'/ I removed the variable from the procedure when it didn't work.
For nSheets = 1 To 30
With Worksheets(nSheets)
LastRow = 0
'/ Find last row
For iCol = 5 To 18 '/Cols E:R
'Placed a "." right before Cells
iRow = .Cells(65536, iCol).End(xlUp).Row
If iRow > LastRow Then LastRow = iRow
Next iCol
'/ Place row totals in column R
For iRow = 2 To LastRow
'Placed a "." right before Cells
'Sum until column C only.
.Cells(iRow, "R") = Application.WorksheetFunction.Sum(Range(.Cells(iRow, "E"), .Cells(iRow, "R")))
Next iRow
'/ Place column total in new last row
For iCol = 5 To 18
'Placed a "." right before Cells
'Sum starting from row 2
.Cells(LastRow + 1, iCol) = Application.WorksheetFunction.Sum(Range(.Cells(3, iCol), Cells(.LastRow, iCol)))
Next iCol
End With
Next nSheets
End Sub