Hello
I have data for theses sheets
what I want:
* brings the balances from BVC sheet first
* if the amount in BALANCE column for BVC sheet is positive then will put in DEBIT column .
* if the amount in BALANCE column for BVC sheet is minus then will put in CREDIT column and covert to positive value as in Hameed, Hamdaan, Manar names
* when brings the amount from BVC sheet then will first row for each name will subtract debit from credit , the next row for the same row will change formula until finish the name( see the first row for each name and the next how calculat)
* when brings the data for names first should sort based on on column A from old date and to last date for the same name ,second sort based names in column B
* if the amount in BALANCE column for BVC sheet contains zero and there is no existed then no need show
* there is new names in sheets and there is no existed at all in BVC sheet then will show
* when there are amounts in BALANCE column for BVC sheet then will brings the date and write in column C the sheet name with date is existed in column A for BVC sheet, PREVIOUS BALANCE in column D .
* when put amounts in column DEBIT,CREDIT depends on words in column D across sheets, then will put theses(Bank withdrawal, Cash withdrawal, Futures Returns purchases, Futures Sales) in DEBIT column, will put theses(Cash deposit, Bank deposit, Futures Sales Returns, Futures purchases ) in CREDIT column .
* based on point 8 will replace with items are existed across sheets(delete after items in point 8) .
* I want macro to implementation for 10000 rows for each sheet.
the result should be
thanks.
I have data for theses sheets
omrany.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | DATE | NAME | DEBIT | CREDIT | BALANCE | ||
2 | 31/12/2023 | Ahmed | 1,000.00 | 1,000.00 | |||
3 | 31/12/2023 | Hamuda | 50,000.00 | 1,000.00 | 49,000.00 | ||
4 | 31/12/2023 | Hameed | 3,000.00 | 5,000.00 | -2,000.00 | ||
5 | 31/12/2023 | Hamdaan | 2,000.00 | -2,000.00 | |||
6 | 31/12/2023 | Muneer | 0.00 | 0.00 | 0.00 | ||
7 | 31/12/2023 | Manar | 1,000.00 | -1,000.00 | |||
BVC |
omrany.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | DATE | NAME | INVOICE NO | CONDITION | AMOUNT | ||
2 | 01/01/2024 | Ahmed | VN number 345666 | Bank withdrawal Ref No 7890 | 3,000.00 | ||
3 | 02/01/2024 | Ahmed | VN number 345667 | Cash withdrawal VCF NO 789000 | 2,000.00 | ||
4 | 03/01/2024 | Ahmed | VN number 345668 | Bank withdrawal Ref No 7891 | 1,200.00 | ||
5 | 04/01/2024 | Ahmed | VN number 345669 | Cash withdrawal VCF NO 789001 | 1,300.00 | ||
6 | 05/01/2024 | Hamuda | VN number 345670 | Futures purchases inv NO 23444 | 2,200.00 | ||
7 | 06/01/2024 | Hamuda | VN number 345671 | Cash withdrawal VCF NO 789002 | 3,400.00 | ||
8 | 07/01/2024 | Ahmed | VN number 345672 | Futures purchases inv NO 23445 | 3,500.00 | ||
9 | 08/01/2024 | Ameer | VN number 345673 | Futures purchases inv NO 23446 | 2,000.00 | ||
10 | 09/01/2024 | Ameer | VN number 345674 | Futures purchases inv NO 23447 | 2,001.00 | ||
SA |
omrany.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | DATE | NAME | INVOICE NO | CONDITION | AMOUNT | ||
2 | 01/01/2024 | Ahmed | VN number 345666 | Bank deposit Ref NO 7892 | 3,000.00 | ||
3 | 02/01/2024 | Hameed | VN number 345667 | Bank deposit Ref NO 7893 | 2,000.00 | ||
4 | 03/01/2024 | Ahmed | VN number 345668 | Cash deposit VCF NO 789003 | 1,200.00 | ||
5 | 04/01/2024 | Hameed | VN number 345669 | Cash deposit VCF NO 789004 | 1,300.00 | ||
6 | 05/01/2024 | Ahmed | VN number 345670 | Futures Sales inv NO 23446 | 3,000.00 | ||
7 | 06/01/2024 | Hameed | VN number 345671 | Cash deposit VCF NO 789005 | 2,000.00 | ||
8 | 07/01/2024 | Ahmed | VN number 345672 | Futures Sales inv NO 23447 | 1,200.00 | ||
9 | 08/01/2024 | Aneen | VN number 345673 | Futures Sales inv NO 23448 | 1,201.00 | ||
10 | 09/01/2024 | Aneen | VN number 345668 | Bank deposit Ref No 7894 | 2,000.00 | ||
VS |
omrany.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | DATE | NAME | INVOICE NO | CONDITION | AMOUNT | ||
2 | 01/01/2024 | Ahmed | VN number 345666 | Cash deposit VCF NO 789005 | 3,000.00 | ||
3 | 02/01/2024 | Ahmed | VN number 345667 | Cash deposit VCF NO 789006 | 2000 | ||
4 | 03/01/2024 | Ahmed | VN number 345668 | Bank deposit Ref NO 7893 | 1200 | ||
5 | 04/01/2024 | Ahmed | VN number 345669 | Bank deposit Ref NO 7894 | 1300 | ||
6 | 05/01/2024 | Ahmed | VN number 345670 | Bank deposit Ref NO 7895 | 2200 | ||
7 | 06/01/2024 | Ahmed | VN number 345671 | Futures Returns purchases inv NO 23446 | 3400 | ||
8 | 07/01/2024 | Ahmed | VN number 345672 | Futures Returns purchases inv NO 23447 | 3500 | ||
9 | 08/01/2024 | Hameed | VN number 345673 | Futures Returns purchases inv NO 23448 | 3501 | ||
10 | 09/01/2024 | Hameed | VN number 345674 | Futures Returns purchases inv NO 23449 | 3502 | ||
11 | 10/01/2024 | Hameed | VN number 345675 | Futures Returns purchases inv NO 23450 | 3503 | ||
12 | 11/01/2024 | Hameed | VN number 345676 | Futures Returns purchases inv NO 23451 | 3504 | ||
13 | 12/01/2024 | Anan | VN number 345677 | Futures Returns purchases inv NO 23452 | 2000 | ||
AP |
omrany.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | DATE | NAME | INVOICE NO | CONDITION | AMOUNT | ||
2 | 01/01/2024 | Ahmed | VN number 345666 | Bank withdrawal Ref No 7892 | 3,000.00 | ||
3 | 02/01/2024 | Ahmed | VN number 345667 | Bank withdrawal Ref No 7893 | 2,000.00 | ||
4 | 03/01/2024 | Ahmed | VN number 345668 | Futures Sales Returns inv NO 23447 | 1,200.00 | ||
5 | 04/01/2024 | Ahmed | VN number 345669 | Futures Sales Returns inv NO 23448 | 1,300.00 | ||
6 | 05/01/2024 | Hamuda | VN number 345670 | Futures Sales Returns inv NO 23449 | 3,000.00 | ||
7 | 06/01/2024 | Hamuda | VN number 345671 | Futures Sales Returns inv NO 23450 | 2,000.00 | ||
8 | 07/01/2024 | Hamuda | VN number 345672 | Futures Sales Returns inv NO 23451 | 1,200.00 | ||
9 | 08/01/2024 | amer | VN number 345673 | Futures Sales Returns inv NO 23452 | 1,201.00 | ||
10 | 09/01/2024 | Anan | VN number 345674 | Futures Sales Returns inv NO 23453 | 2,000.00 | ||
11 | 09/01/2024 | Ameer | VN number 345675 | Futures purchases inv NO 23455 | 3000 | ||
SSC |
omrany.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | DATE | NAME | INVOICE NO | CONDITION | DEBIT | CREDIT | BALANCE | ||
2 | |||||||||
3 | |||||||||
4 | |||||||||
5 | |||||||||
6 | |||||||||
7 | |||||||||
8 | |||||||||
9 | |||||||||
10 | |||||||||
11 | |||||||||
12 | |||||||||
ACC |
what I want:
* brings the balances from BVC sheet first
* if the amount in BALANCE column for BVC sheet is positive then will put in DEBIT column .
* if the amount in BALANCE column for BVC sheet is minus then will put in CREDIT column and covert to positive value as in Hameed, Hamdaan, Manar names
* when brings the amount from BVC sheet then will first row for each name will subtract debit from credit , the next row for the same row will change formula until finish the name( see the first row for each name and the next how calculat)
* when brings the data for names first should sort based on on column A from old date and to last date for the same name ,second sort based names in column B
* if the amount in BALANCE column for BVC sheet contains zero and there is no existed then no need show
* there is new names in sheets and there is no existed at all in BVC sheet then will show
* when there are amounts in BALANCE column for BVC sheet then will brings the date and write in column C the sheet name with date is existed in column A for BVC sheet, PREVIOUS BALANCE in column D .
* when put amounts in column DEBIT,CREDIT depends on words in column D across sheets, then will put theses(Bank withdrawal, Cash withdrawal, Futures Returns purchases, Futures Sales) in DEBIT column, will put theses(Cash deposit, Bank deposit, Futures Sales Returns, Futures purchases ) in CREDIT column .
* based on point 8 will replace with items are existed across sheets(delete after items in point 8) .
* I want macro to implementation for 10000 rows for each sheet.
the result should be
omrany.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | DATE | NAME | INVOICE NO | CONDITION | DEBIT | CREDIT | BALANCE | ||
2 | 31/12/2023 | Ahmed | BVC OF DATE 31/12/2023 | PREVIOUS BALANCE | 1,000.00 | 1,000.00 | |||
3 | 01/01/2024 | Ahmed | VN number 345666 | Bank withdrawal | 3,000.00 | 4,000.00 | |||
4 | 01/01/2024 | Ahmed | VN number 345666 | Cash deposit | 3,000.00 | 1,000.00 | |||
5 | 01/01/2024 | Ahmed | VN number 345666 | Bank withdrawal | 3,000.00 | 4,000.00 | |||
6 | 02/01/2024 | Ahmed | VN number 345668 | Bank withdrawal | 1,200.00 | 5,200.00 | |||
7 | 02/01/2024 | Ahmed | VN number 345667 | Cash deposit | 2,000.00 | 3,200.00 | |||
8 | 02/01/2024 | Ahmed | VN number 345667 | Bank withdrawal | 2,000.00 | 5,200.00 | |||
9 | 03/01/2024 | Ahmed | VN number 345668 | Bank deposit | 1,200.00 | 4,000.00 | |||
10 | 03/01/2024 | Ahmed | VN number 345667 | Cash withdrawal | 2,000.00 | 6,000.00 | |||
11 | 03/01/2024 | Ahmed | VN number 345668 | Bank deposit | 1,200.00 | 4,800.00 | |||
12 | 03/01/2024 | Ahmed | VN number 345668 | Futures Sales Returns | 1,200.00 | 3,600.00 | |||
13 | 04/01/2024 | Ahmed | VN number 345669 | Bank deposit | 1,300.00 | 2,300.00 | |||
14 | 04/01/2024 | Ahmed | VN number 345669 | Cash withdrawal | 1,300.00 | 3,600.00 | |||
15 | 04/01/2024 | Ahmed | VN number 345669 | Bank deposit | 1,300.00 | 2,300.00 | |||
16 | 04/01/2024 | Ahmed | VN number 345669 | Futures Sales Returns | 1,300.00 | 1,000.00 | |||
17 | 05/01/2024 | Ahmed | VN number 345670 | Bank deposit | 2,200.00 | -1,200.00 | |||
18 | 05/01/2024 | Ahmed | VN number 345672 | Futures purchases | 3,500.00 | -4,700.00 | |||
19 | 05/01/2024 | Ahmed | VN number 345670 | Bank deposit | 2,200.00 | -6,900.00 | |||
20 | 06/01/2024 | Ahmed | VN number 345666 | Bank deposit | 3,000.00 | -9,900.00 | |||
21 | 06/01/2024 | Ahmed | VN number 345671 | Futures Returns purchases | 3,400.00 | -6,500.00 | |||
22 | 07/01/2024 | Ahmed | VN number 345668 | Cash deposit | 1,200.00 | -7,700.00 | |||
23 | 07/01/2024 | Ahmed | VN number 345672 | Futures Returns purchases | 3,500.00 | -4,200.00 | |||
24 | 08/01/2024 | Ahmed | VN number 345670 | Futures Sales | 3,000.00 | -1,200.00 | |||
25 | 09/01/2024 | Ahmed | VN number 345672 | Futures Sales | 1,200.00 | 0.00 | |||
26 | 08/01/2024 | Ameer | VN number 345673 | Futures purchases | 2,000.00 | -2,000.00 | |||
27 | 09/01/2024 | Ameer | VN number 345674 | Futures purchases | 2,001.00 | -4,001.00 | |||
28 | 09/01/2024 | Ameer | VN number 345675 | Futures purchases | 3,000.00 | -7,001.00 | |||
29 | 08/01/2024 | amer | VN number 345673 | Futures Sales Returns | 1,201.00 | -1,201.00 | |||
30 | 09/01/2024 | Anan | VN number 345674 | Futures Sales Returns | 2,000.00 | -2,000.00 | |||
31 | 12/01/2024 | Anan | VN number 345677 | Futures Returns purchases | 2,000.00 | 0.00 | |||
32 | 08/01/2024 | Aneen | VN number 345673 | Futures Sales | 1,201.00 | 1,201.00 | |||
33 | 09/01/2024 | Aneen | VN number 345668 | Bank deposit | 2,000.00 | -799.00 | |||
34 | 31/12/2023 | Hamdaan | BVC OF DATE 31/12/2023 | PREVIOUS BALANCE | 2,000.00 | -2,000.00 | |||
35 | 31/12/2023 | Hameed | BVC OF DATE 31/12/2023 | PREVIOUS BALANCE | 2,000.00 | -2,000.00 | |||
36 | 02/01/2024 | Hameed | VN number 345667 | Bank deposit | 2,000.00 | -4,000.00 | |||
37 | 04/01/2024 | Hameed | VN number 345669 | Cash deposit | 1,300.00 | -5,300.00 | |||
38 | 06/01/2024 | Hameed | VN number 345671 | Cash deposit | 2,000.00 | -7,300.00 | |||
39 | 08/01/2024 | Hameed | VN number 345673 | Futures Returns purchases | 3,501.00 | -3,799.00 | |||
40 | 09/01/2024 | Hameed | VN number 345674 | Futures Returns purchases | 3,502.00 | -297.00 | |||
41 | 10/01/2024 | Hameed | VN number 345675 | Futures Returns purchases | 3,503.00 | 3,206.00 | |||
42 | 11/01/2024 | Hameed | VN number 345676 | Futures Returns purchases | 3,504.00 | 6,710.00 | |||
43 | 31/12/2023 | Hamuda | BVC OF DATE 31/12/2023 | PREVIOUS BALANCE | 49,000.00 | 49,000.00 | |||
44 | 05/01/2024 | Hamuda | VN number 345670 | Futures purchases | 2,200.00 | 46,800.00 | |||
45 | 06/01/2024 | Hamuda | VN number 345671 | Cash withdrawal | 3,400.00 | 50,200.00 | |||
46 | 05/01/2024 | Hamuda | VN number 345670 | Futures Sales Returns | 3,000.00 | 47,200.00 | |||
47 | 06/01/2024 | Hamuda | VN number 345671 | Futures Sales Returns | 2,000.00 | 45,200.00 | |||
48 | 07/01/2024 | Hamuda | VN number 345672 | Futures Sales Returns | 1,200.00 | 44,000.00 | |||
49 | 31/12/2023 | Manar | BVC OF DATE 31/12/2024 | PREVIOUS BALANCE | 1,000.00 | -1,000.00 | |||
ACC |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G2,G49,G34:G35,G32,G29:G30,G26 | G2 | =E2-F2 |
G44:G48,G36:G42,G33,G31,G27:G28,G3:G25 | G3 | =G2+E3-F3 |
thanks.