Sum dynamic range

sfran

New Member
Joined
Mar 9, 2021
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to sum a range of cells starting from "B8" to a variable end row in the same column. I have tried various ways to try to accomplish this, but seems to keep failing. I would like to have the cell 2 rows below the end of this range to show the total. The code I am currently using is:

Sheets(Sheets.Count).Cells(featsummaryrow, 2) = Application.Sum(Range(Cells(8, 2), Cells(featsummaryrow - 2, 2)))

In other tests I have done, the Sheets(Sheets.Count).Cells(featsummaryrow, 2) portion is properly working (just had it equal to a number and it populates correctly). It seems my trouble is with the "summation" side of the equation. Have tried using .formula and other methods... i'm still doing something wrong.

Any insight is appreciated.

Thanks!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about
VBA Code:
With Sheets(Sheets.Count)
   .Cells(featsummaryrow, 2) = Application.Sum(.Range(.Cells(8, 2), .Cells(featsummaryrow - 2, 2)))
End With
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,020
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top