Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find last used row and insert total

Status
Not open for further replies.

Delindan

MIS
May 27, 2011
203
US
I have created a spreadsheet by exporting from Access to Excel and now have been trying to clean it up by inserting totals at the bottom of the exported columns. I'm trying to find out 2 things: how to find the last row of data and how to insert the excel =sum() function. Can anyone help?

Thanks!
 


Code:
    With xlApp.Worksheets(1)
        .Cells(introw + 2, 5).Formula = "=SUM(F2:" & .Cells(introw, 5).Address(False, False) & ")"
    End With


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
This works without errors! The equation looks correct in the spreadsheet as well. Interestingly, it is giving me a different sum number than if I manually put in the equation. The manual sum is 310 and the number it gives is 428. Doesn't seem to be an obvious reason. I'll look at it more. Thanks
 
Ok...figured it out and modified where necessary. Thanks for all the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top