delete duplicates items and keep duplicates others based on matching partial text and value

tubrak

Board Regular
Joined
May 30, 2021
Messages
216
Office Version
  1. 2019
Platform
  1. Windows
Hi
I hope finding macro for bout 11000 rows between two sheets
should delete the items and add the others in sheet main based on matching sheet DATA with this cases
1- should match the partial text in column C (INVOICE,RECEIVABLE) and match the values whether in column D or E .
2- if there is the same partial text in column C (INVOICE,RECEIVABLE) and the same values in column D or E for two sheets , then shouldn't delete from sheet main with considering the repeated items should be the same in counting
this means if I have partial text in column C (INVOICE,RECEIVABLE) and the same values in column D or E for are repeated four times in sheet DATA but in sheet main are repeated three times then should add the fourth duplicates item into sheet MAIN to become four items as sheet DATA . as to if I have partial text in column C (INVOICE,RECEIVABLE) and the same values in column D or E for are repeated four times in sheet MAIN but in sheet DATA are repeated three times then should delete the the fourth item duplicated from sheet MAIN to become equal three duplicates items like sheet DATA .
3- if I have partial text in column C (INVOICE,RECEIVABLE) and the same values in column D or E in sheet DATA but not repeated item and not existed in sheet MAIN then should add it to sheet MAIN ,if I have partial text in column C (INVOICE,RECEIVABLE) and the same values in column D or E in sheet MAIN but not repeated item and not existed in sheet DATA then should delete it from sheet MAIN
4- any thing else except (INVOICE,RECEIVABLE) is existed in sheet MAIN then should deleted except row2 contains OPENING in column C.every time I will add new data in two sheets.
5- should highlight new items are existed in sheet but not is another as I did it .
the matching should be based on partial text and the same values together .
last thing I want the result in sheet OUTPUT with keeping the original data in two sheets ,should clear data in sheet output before bring data when run the macro . and sort it the first invoice and the second RECEIVABLE with make the duplicates values under each other of them .
cs1 ans.xlsm
ABCDEF
1ITEMDATEDESCRIPEDEBITCREDITBALANCE
211/1/2021OPENINIG10000001000000
321/2/2021INVOICE-A234100001,010,000.00
431/3/2021RECEIVABLE VOUCHER A2331,500.001,008,500.00
541/4/2021RECEIVABLE VOUCHER A234500.001,008,000.00
651/5/2021INVOICE-A23320001,010,000.00
751/6/2021INVOICE-A23420001,012,000.00
861/7/2021INVOICE-A23530001,015,000.00
971/8/2021INVOICE-A2362001,015,200.00
1081/9/2021INVOICE-A2373001,015,500.00
1191/10/2021INVOICE-A2384001,015,900.00
12101/5/2021RECIEVABLE VOUCHER A235500.001,015,400.00
13111/14/2021RECIEVABLE VOUCHER A236500.001,014,900.00
14121/13/2021RECEIVABLE VOUCHER A2371,000.001,013,900.00
15131/15/2021RECEIVABLE VOUCHER A238500.001,013,400.00
16141/15/2021INVOICE-A23920001,015,400.00
data
Cell Formulas
RangeFormula
F2F2=D2-E2
F3:F16F3=F2+D3-E3



cs1 ans.xlsm
ABCDEF
1ITEMDATEDESCRIPEDEBITCREDITBALANCE
211/1/2021OPENINIG10000001,000,000.00
321/2/2021INVOICE-MS22100001,010,000.00
431/3/2021RECEIVABLE VOUCHER M441,500.001,008,500.00
541/4/2021RECEIVABLE VOUCHER NH23500.001,008,000.00
651/5/2021RECEIVABLE VOUCHER NH24500.001,007,500.00
761/6/2021INVOICE NO STR23420001,009,500.00
871/7/2021INVOICE NO STR23530001,012,500.00
981/8/2021INVOICE NO STR2362001,012,700.00
1091/9/2021INVOICE NO STR2373001,013,000.00
11101/10/2021INVOICE NO STR2384001,013,400.00
12111/11/2021INVOICE NO STR23915001,014,900.00
13121/12/2021PAYAPALE VOUCHER A23510001,015,900.00
14131/13/2021PAYAPALE VOUCHER A236500.001,015,400.00
15141/14/2021RECEIVABLE VOUCHER NH25500.001,014,900.00
16151/15/2021RECEIVABLEVOUCHER NH261,500.001,013,400.00
17161/16/2021INVOICE NO STR2404001,013,800.00
18171/17/2021INVOICE NO STR2414001,014,200.00
main
Cell Formulas
RangeFormula
F2F2=D2-E2
F3:F18F3=F2+D3-E3


result


cs1 ans.xlsm
ABCDEF
1ITEMDATEDESCRIPEDEBITCREDITBALANCE
211/1/2021OPENINIG10000001,000,000.00
321/2/2021INVOICE-MS22100001,010,000.00
431/6/2021INVOICE NO STR23420001,012,000.00
541/6/2021INVOICE-A23420001,014,000.00
651/15/2021INVOICE-A23920001,016,000.00
761/7/2021INVOICE NO STR23530001,019,000.00
871/8/2021INVOICE NO STR2362001,019,200.00
981/9/2021INVOICE NO STR2373001,019,500.00
1091/10/2021INVOICE NO STR2384001,019,900.00
11101/13/2021RECIEVABLE VOUCHER A2371,000.001,018,900.00
12111/3/2021RECIEVABLE VOUCHER M441,500.001,017,400.00
13121/4/2021RECIEVABLE VOUCHER NH23500.001,016,900.00
14131/5/2021RECIEVABLE VOUCHER NH24500.001,016,400.00
15141/14/2021RECIEVABLE VOUCHER NH25500.001,015,900.00
16151/14/2021RECIEVABLE VOUCHER A238500.001,015,400.00
output
Cell Formulas
RangeFormula
F2F2=D2-E2
F3:F16F3=F2+D3-E3




sorry for big explanation , but it's necessary
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,214,784
Messages
6,121,538
Members
449,038
Latest member
Guest1337

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