search for macro to sum amount for each sheet based on month

Hasson

Active Member
Joined
Apr 8, 2021
Messages
390
Office Version
  1. 2016
Platform
  1. Windows
Hello
I need macro to deal with about 3500 rows for each sheet , every time I add new sheets and data before OUTCOME sheet
I want sum whole of BALANCE column for each sheet based on month , but if any sheet contains BALANCE word in row Except header in row1 should exclude it until avoid sum amount twice .
so the result should be as in OUTCOME sheet with populate sheets names in column B and insert CAL row to sum all of sheets for each month .
MONTHS.xlsm
EFGHIJK
1ITEMDATEBATCHINV NOQTYPRICEBALANCE
2101/01/2023BTS00INV-00120.00120.002,400.00
3201/01/2023BTS01INV-00150.00110.005,500.00
4301/01/2023BTS02INV-00150.00221.0011,050.00
5401/01/2023BTS03INV-00160.00122.007,320.00
6BALANCE01/01/2023INV-00126,270.00
7103/01/2023BTS01INV-00270.00120.008,400.00
8203/01/2023BTS02INV-00280.00115.009,200.00
9303/01/2023BTS00INV-00260.00112.006,720.00
10BALANCE03/01/2023INV-00224,320.00
11103/01/2023BTS01INV-00380.00122.009,760.00
12204/01/2023BTS02INV-00380.00111.008,880.00
13305/01/2023BTS00INV-00380.00120.009,600.00
14BALANCE06/01/2023INV-00328,240.00
15103/02/2023BTS01INV-004200.00110.0022,000.00
16204/02/2023BTS02INV-004100.00120.0012,000.00
17305/02/2023BTS00INV-004120.0012.001,440.00
18BALANCEINV-00435,440.00
SH1
Cell Formulas
RangeFormula
K15:K17,K11:K13,K7:K9,K2:K5K2=I2*J2
K6K6=SUM(K2:K5)
K10,K18,K14K10=SUM(K7:K9)


MONTHS.xlsm
EFGHIJK
1ITEMDATEBATCHINV NOQTYPRICEBALANCE
2101/01/2023BTS00STT-00112.001,222.0014,664.00
3201/01/2023BTS01STT-00110.00122.001,220.00
4301/01/2023BTS02STT-0015.00244.001,220.00
5401/01/2023BTS03STT-00122.00145.003,190.00
6BALANCE01/01/2023STT-00120,294.00
7103/01/2023BTS01STT-00212.00130.001,560.00
8203/01/2023BTS02STT-00210.00230.002,300.00
9303/01/2023BTS00STT-0025.00150.00750.00
10BALANCE03/01/2023STT-0024,610.00
11103/01/2023BTS01STT-00320.00130.002,600.00
12204/01/2023BTS02STT-00312.00230.002,760.00
13305/01/2023BTS00STT-00322.00150.003,300.00
14BALANCE06/01/2023STT-0038,660.00
15103/02/2023BTS01STT-00320.00130.002,600.00
16204/02/2023BTS02STT-00312.00230.002,760.00
17305/02/2023BTS00STT-00322.00150.003,300.00
18BALANCE06/02/2023STT-0038,660.00
19103/02/2023BTS01STT-003134.00130.0017,420.00
20204/02/2023BTS02STT-00324.00230.005,520.00
21305/02/2023BTS00STT-00334.00150.005,100.00
22BALANCE06/02/2023STT-00328,040.00
MSH
Cell Formulas
RangeFormula
K19:K21,K15:K17,K11:K13,K7:K9,K2:K5K2=I2*J2
K6K6=SUM(K2:K5)
K10,K22,K18,K14K10=SUM(K7:K9)



MONTHS.xlsm
EFGHI
1ITEMDATENAMEVOUCHER NOBALANCE
2111/03/2023HS1VGN 20002,000.00
3212/03/2023HS1VBH6771,800.00
4313/03/2023HS1CVF5001,700.00
ASW



result what I want
MONTHS.xlsm
ABCDEFGHIJKLMN
1ITEMSHEET NAMEJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
21SH178,830.0035,440.00----------
32MSH33,564.0036,700.00----------
43ASW--5,500.00---------
5CAL112,394.0072,140.005,500.000.000.000.000.000.000.000.000.000.00
OUTCOME
Cell Formulas
RangeFormula
C5:N5C5=SUM(C2:C4)

thanks in advance
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,129
Messages
6,123,214
Members
449,091
Latest member
jeremy_bp001

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