Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to compare two sheet using vba and remove duplicate content?
Hi, need urgent help
I have 2 sheets need to compare and delete duplicate content using VBA For Example : Before Sheet1 A B C 222 Diode D506 333 Capasitor C123 - duplicate row 132 Transistor T525 555 Coil CL121 - duplicate row Sheet2 333 Capasitor C123 - duplicate row 555 Coil CL121 - duplicate row 555 Coil CL121 - duplicate row x 2 444 Diode D444 444 Transistor T444 After Sheet1 222 Diode D506 132 Transistor T525 Sheet2 444 Diode D444 444 Transistor T444 555 Coil CL121 Meaning I have to remove duplicate row inbetween sheet1 and sheet2 base on one to one. Pls help to give me VBA code on how to do. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to compare two sheet using vba and remove duplicate content?
its easy if you haev everything in one sheet
'select table to copy sheet2.Range("A1").CurrentRegion.Copy 'now paste it below existing data Sheet1.Range("A1").End(xldown).Offset(1).Pastspeci al xlall application.cutcopymode = false 'sort the new table off column A range("A1").Sort Range("A1") ' remove duplicates for rw = range("A1").end(xldown).row to 2 step -1 if cells(rw,1) = cells(rw-1,1) then rows(rw).delete end if next "geniusideas" wrote: Hi, need urgent help I have 2 sheets need to compare and delete duplicate content using VBA For Example : Before Sheet1 A B C 222 Diode D506 333 Capasitor C123 - duplicate row 132 Transistor T525 555 Coil CL121 - duplicate row Sheet2 333 Capasitor C123 - duplicate row 555 Coil CL121 - duplicate row 555 Coil CL121 - duplicate row x 2 444 Diode D444 444 Transistor T444 After Sheet1 222 Diode D506 132 Transistor T525 Sheet2 444 Diode D444 444 Transistor T444 555 Coil CL121 Meaning I have to remove duplicate row inbetween sheet1 and sheet2 base on one to one. Pls help to give me VBA code on how to do. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to compare two sheet using vba and remove duplicate conten
check for typos!
i had 'Pastspecial' and it should be Pastespecial use Edit/Compile before runnign code. sorry, I'm in a hurry ;) "Patrick Molloy" wrote: its easy if you haev everything in one sheet 'select table to copy sheet2.Range("A1").CurrentRegion.Copy 'now paste it below existing data Sheet1.Range("A1").End(xldown).Offset(1).Pastspeci al xlall application.cutcopymode = false 'sort the new table off column A range("A1").Sort Range("A1") ' remove duplicates for rw = range("A1").end(xldown).row to 2 step -1 if cells(rw,1) = cells(rw-1,1) then rows(rw).delete end if next "geniusideas" wrote: Hi, need urgent help I have 2 sheets need to compare and delete duplicate content using VBA For Example : Before Sheet1 A B C 222 Diode D506 333 Capasitor C123 - duplicate row 132 Transistor T525 555 Coil CL121 - duplicate row Sheet2 333 Capasitor C123 - duplicate row 555 Coil CL121 - duplicate row 555 Coil CL121 - duplicate row x 2 444 Diode D444 444 Transistor T444 After Sheet1 222 Diode D506 132 Transistor T525 Sheet2 444 Diode D444 444 Transistor T444 555 Coil CL121 Meaning I have to remove duplicate row inbetween sheet1 and sheet2 base on one to one. Pls help to give me VBA code on how to do. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compare Two Simple Workbooks & Remove Duplicate Rows | Excel Discussion (Misc queries) | |||
How do I remove or filter out duplicate records in a sheet? | Excel Discussion (Misc queries) | |||
Identifying duplicate content in column | Excel Programming | |||
Cell content elimination; duplicate | Excel Worksheet Functions | |||
Can excel remove the duplicate rows in a spread sheet? | Excel Programming |