Hello
I have about 1000 names ,could repeat for more than 7000 rows
so what I want put the data for the same name under each other of duplicates names and insert new column to calculation based on column B.
and should brings the balances from OPEN BALANCES for each name and put in first row for each name before filter data. and if there is no name in OPEN BALANCES sheet and it's existed in CUSTOMERS sheet ,then should show zero in column BALANCE.
so when filter in RESULT sheet brings balance for each name from OPEN BALANCES and insert column BALANCE and calculation as I put the formula .
result
if the balance for each name in OPEN BALANCES sheet is minus should put in CREDIT column and the same value put in BALANCE column ,if the balance for each name in OPEN BALANCES sheet is positive should put in DEBIT column and the same value put in BALANCE column and should write OPEN BALANCE in column D for the same row brings value from OPEN BALANCES sheet .
every time when run the macro should clear data in RESULT sheet.
thanks
I have about 1000 names ,could repeat for more than 7000 rows
so what I want put the data for the same name under each other of duplicates names and insert new column to calculation based on column B.
and should brings the balances from OPEN BALANCES for each name and put in first row for each name before filter data. and if there is no name in OPEN BALANCES sheet and it's existed in CUSTOMERS sheet ,then should show zero in column BALANCE.
er | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | DATE | NAME | ORDER NO | CONDITION | DEBIT | CREDIT | ||
2 | 06/02/2023 | ALAA-1 | ORD-001 | N/H | 20000 | |||
3 | 06/02/2023 | ALAA-1 | ORD-002 | M/H | 20000 | 1000 | ||
4 | 06/02/2023 | ALAA-2 | ORD-003 | MM/N | 10000 | |||
5 | 06/02/2023 | ALAA-1 | ORD-004 | B/N | 2000 | 100 | ||
6 | 06/02/2023 | ALAA-1 | ORD-004 | B/NN | 100 | |||
7 | 06/02/2023 | ALAA-2 | ORD-005 | T/R | 1000 | |||
8 | 06/02/2023 | ALAA-3 | ORD-006 | MNG | 1200 | |||
9 | 06/02/2023 | ALAA-2 | ORD-007 | ITSR | 1200 | 150 | ||
10 | 06/02/2023 | ALAA-2 | ORD-007 | ITSRI | 200 | 100 | ||
11 | 06/02/2023 | ALAA-3 | ORD-008 | ITRE | 200 | |||
12 | 06/02/2023 | ALAA-3 | ORD-009 | ITRE | 100 | |||
13 | 06/02/2023 | ALAA-3 | ORD-010 | ITRE | 100 | |||
14 | 06/02/2023 | ALAA-3 | ORD-011 | ITRE | 1000 | |||
15 | 06/02/2023 | ALAA-3 | ORD-012 | ITRE | 1200 | |||
16 | 06/02/2023 | ALAA-3 | ORD-013 | ITRE | 200 | |||
17 | 06/02/2023 | ALAA-3 | ORD-014 | ITRE | 100 | 50 | ||
CUSTOMERS |
er | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | ITEM | NAME | BALANCE | ||
2 | 1 | ALAA-1 | 1200 | ||
3 | 2 | ALAA-2 | -200 | ||
4 | |||||
OPEN BALNCES |
so when filter in RESULT sheet brings balance for each name from OPEN BALANCES and insert column BALANCE and calculation as I put the formula .
result
er | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | DATE | NAME | ORDER NO | CONDITION | DEBIT | CREDIT | BALANCES | ||
2 | 06/02/2023 | ALAA-1 | OPEN BALANCE | 1200 | 1200 | ||||
3 | 06/02/2023 | ALAA-1 | ORD-001 | N/H | 20000 | 21200 | |||
4 | 06/02/2023 | ALAA-1 | ORD-002 | M/H | 20000 | 1000 | 40200 | ||
5 | 06/02/2023 | ALAA-1 | ORD-004 | B/N | 2000 | 100 | 42100 | ||
6 | 06/02/2023 | ALAA-1 | ORD-004 | B/NN | 100 | 42200 | |||
7 | 06/02/2023 | ALAA-2 | OPEN BALANCE | -200 | -200 | ||||
8 | 06/02/2023 | ALAA-2 | ORD-003 | MM/N | 10000 | 9800 | |||
9 | 06/02/2023 | ALAA-2 | ORD-005 | T/R | 1000 | 10800 | |||
10 | 06/02/2023 | ALAA-2 | ORD-007 | ITSR | 1200 | 150 | 11850 | ||
11 | 09/02/2023 | ALAA-2 | ORD-007 | ITSRI | 200 | 100 | 11950 | ||
12 | 06/02/2023 | ALAA-3 | OPEN BALANCE | 0 | |||||
13 | 06/02/2023 | ALAA-3 | ORD-006 | MNG | 1200 | 1200 | |||
14 | 10/02/2023 | ALAA-3 | ORD-008 | ITRE | 200 | 1400 | |||
15 | 11/02/2023 | ALAA-3 | ORD-009 | ITRE | 100 | 1500 | |||
16 | 12/02/2023 | ALAA-3 | ORD-010 | ITRE | 100 | 1400 | |||
17 | 13/02/2023 | ALAA-3 | ORD-011 | ITRE | 1000 | 2400 | |||
18 | 14/02/2023 | ALAA-3 | ORD-012 | ITRE | 1200 | 3600 | |||
19 | 15/02/2023 | ALAA-3 | ORD-013 | ITRE | 200 | 3400 | |||
20 | 16/02/2023 | ALAA-3 | ORD-014 | ITRE | 100 | 50 | 3450 | ||
RESULT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G13:G20,G8:G11,G3:G6 | G3 | =G2+E3-F3 |
if the balance for each name in OPEN BALANCES sheet is minus should put in CREDIT column and the same value put in BALANCE column ,if the balance for each name in OPEN BALANCES sheet is positive should put in DEBIT column and the same value put in BALANCE column and should write OPEN BALANCE in column D for the same row brings value from OPEN BALANCES sheet .
every time when run the macro should clear data in RESULT sheet.
thanks