troubleshooting Question

excel vba sum a range of cells on another sheet

Avatar of Lambel
Lambel asked on
Microsoft Excel
2 Comments1 Solution476 ViewsLast Modified:
I am trying to do something I thought would be fairly simple, but is causing me quite a bit of headache!  I need to use vba to go to a sheet in an open workbook, start at the top of the data, (usually row 2), select all the data in the column and insert a sum at the bottom.  This is really easy to do manually, but I can't get the code to reproduce it.  

        Dim nextCell As Variant
        nextCell = ActiveCell.Offset(1, 0).Row
        ActiveCell.FormulaR1C1 = "=SUM(R[-832]C:R[-1]C)"

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros