Auto Sum VBA help

tezza

Active Member
Joined
Sep 10, 2006
Messages
391
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi

I'm looking to replace a set value (shown in a box with red) with an autosum value using VBA. (same idea for the Adjusted Column).

The Actual Column will autosum the values in the duration column for each group, basic example below. This needs to happen for all group totals based on number of rows filled in Col A

1741257179677.png


The example below would do the following until there's no data left:

D10 = Sum E3:E9
F10 = Sum F3:F9

D15 = Sum E11:E14
F15 = Sum E11:E14

D20 = Sum E16:E19
F20 = Sum F16:F19

With an additional sum two rows underneath the last row shows:

Col C(last row plus 2) = Sum Col C
Col D(last row plus 2) = Sum Col D

ECM Report 1 26-01-25.xlsx
ABCDEF
3Monday 20/01/2025A K17:54 - 18:222828
4Tuesday 21/01/2025A K17:55 - 18:222727
5Wednesday 22/01/2025D W18:30 - 19:033333
6Thursday 23/01/2025M W18:15 - 18:362121
7Friday 24/01/2025S C18:32 - 18:592727
8Saturday 25/01/2025S C17:45 - 18:021717
9Sunday 26/01/2025Y C18:29 - 19:013232
10Totals 7185-45185
11Monday 20/01/2025S C10:45 - 11:456060
12Wednesday 22/01/2025S M10:25 - 11:245959
13Friday 24/01/2025S M10:54 - 11:596565
14Sunday 26/01/2025J B10:45 - 11:395454
15Totals 42382238
16Tuesday 21/01/2025J B08:55 - 09:556060
17Wednesday 22/01/2025S P08:56 - 10:016565
18Thursday 23/01/2025S J09:04 - 10:025858
19Friday 24/01/2025A Y08:57 - 10:026565
20Totals 424852248
Report_1
Cell Formulas
RangeFormula
D10D10=SUM(E3:E9)
E10E10=140-D10
D15,D20D15=SUM(E11:E14)
E15E15=240-D15
F3:F9,F11:F14,F16:F19F3=MOD(RIGHT(D3,5)-LEFT(D3,5),1)*1440
F10F10=SUM(F3:F9)
F15,F20F15=SUM(F11:F14)
E20E20=300-D20


Thank you.
 

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