ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Removing items on Sheet1 that are common to Sheet2 (https://www.excelbanter.com/excel-worksheet-functions/262579-removing-items-sheet1-common-sheet2.html)

email4kh

Removing items on Sheet1 that are common to Sheet2
 
Sheet1 and Sheet2 have identical data on some rows. In Excel 2003, how do I
find and remove all the rows on Sheet1 that are also on Sheet2?

Don Guillett[_2_]

Removing items on Sheet1 that are common to Sheet2
 
?? SAME row on each??
sub delduprows()
dim i as long
for i = cells(rows.count,"a").end(xlup).row to 2 step -1
if cells(i,"a")=sheets("sheet2").cell(i,"a") then rows(i).delete
next i
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"email4kh" wrote in message
...
Sheet1 and Sheet2 have identical data on some rows. In Excel 2003, how do
I
find and remove all the rows on Sheet1 that are also on Sheet2?




All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com