Sum above to blank cell - dynamic range

jasonfish11

Board Regular
Joined
May 14, 2015
Messages
56
Hi,
I'm building a macro and trying to add sums in the total sections. I would like to sum everything above the formula until it reaches the 2nd blank cell (stopping at the header).

I'm struggling a bit with the logic.

Example I want to sum O9-O13 (notice O13 is a blank cell, hence the desire to go to 2nd blank) and put that total in O14. I also want to sum O17:O19 and have that value in O20, etc etc until I have no more data sub-sections.

The rows data in these subsections will be dynamic based on the reports I'm getting.

Any help with the logic would be greatly appreciated.

Thank you in advance,
Jason
 

Attachments

  • picture.png
    picture.png
    29.8 KB · Views: 8
Last edited:
You're welcome & thanks for the feedback.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

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