Change needed to develop a macro - insert a row, subtotal and copy headers

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
165
Office Version
  1. 2010
Platform
  1. Windows
Good evening,

I already have a working macro which separates rows when a total of 45 is met.
I then run my next macro with inserts a total in bold blue:

Sub format()
Dim Rng As Range

For Each Rng In Range("C2", Range("C" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
With Rng.Offset(Rng.Count).Resize(1)
.Formula = "=sum(" & Rng.Address & ")"
.Font.Bold = True
.Interior.Color = 14470546
End With
Next Rng
End Sub

Is it possible to add to this macro so that it copies the data in A3, B3, C3 and inserts them into the blank row then moving the totals into column D.

This is what I have:
NEW WAVE FILE TRUNKS.xlsm
ABC
1
2Store No.Store NamePallets
3114Jersey1
4114Jersey1
5114Jersey1
6865Broadstairs1
7865Broadstairs1
8865Broadstairs1
9865Broadstairs1
10800Canterbury1
11800Canterbury1
12800Canterbury1
13800Canterbury1
14800Canterbury1
15800Canterbury1
16800Canterbury1
17800Canterbury1
18800Canterbury1
19800Canterbury1
20800Canterbury1
21265Ashford1
22265Ashford1
23265Ashford1
24265Ashford1
25265Ashford1
26265Ashford1
27965Sittingbourne1
28965Sittingbourne1
29965Sittingbourne1
30965Sittingbourne1
31965Sittingbourne1
32965Sittingbourne1
33475Hastings1
34475Hastings1
35475Hastings1
36475Hastings1
37475Hastings1
38840Eastbourne1
39840Eastbourne1
40840Eastbourne1
41840Eastbourne1
42840Eastbourne1
43840Eastbourne1
44840Eastbourne1
45840Eastbourne1
46840Eastbourne1
47840Eastbourne1
4845
Sheet3
Cell Formulas
RangeFormula
C48C48=SUM($C$2:$C$47)


This is what I want:

NEW WAVE FILE TRUNKS.xlsm
ABCD
1
2Store No.Store NamePallets
3114Jersey1
4114Jersey1
5114Jersey1
6865Broadstairs1
7865Broadstairs1
8865Broadstairs1
9865Broadstairs1
10800Canterbury1
11800Canterbury1
12800Canterbury1
13800Canterbury1
14800Canterbury1
15800Canterbury1
16800Canterbury1
17800Canterbury1
18800Canterbury1
19800Canterbury1
20800Canterbury1
21265Ashford1
22265Ashford1
23265Ashford1
24265Ashford1
25265Ashford1
26265Ashford1
27965Sittingbourne1
28965Sittingbourne1
29965Sittingbourne1
30965Sittingbourne1
31965Sittingbourne1
32965Sittingbourne1
33475Hastings1
34475Hastings1
35475Hastings1
36475Hastings1
37475Hastings1
38840Eastbourne1
39840Eastbourne1
40840Eastbourne1
41840Eastbourne1
42840Eastbourne1
43840Eastbourne1
44840Eastbourne1
45840Eastbourne1
46840Eastbourne1
47840Eastbourne1
48Store No.Store NamePallets45
Sheet3
Cell Formulas
RangeFormula
D48D48=SUM($C$2:$C$47)


I am hoping that with titles inserted I can re pivot to summarize the data again? Or is this not the way to do it?
I have split my data into singles, so I could separate into loads as there will often be split loads. Now I need to summarise the ones again to produce a plan that can be followed.

Any help greatly appreciated.

Sara
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,561
Messages
6,120,234
Members
448,951
Latest member
jennlynn

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