lnLastRow = oExcel.activesheet.UsedRange.Rows.Count oExcel.activesheet.Cells(lnLastRow+1,1).Formula = '=SUM(cells(1,1):cells(lnLastRow,1))