ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting Duplicate Rows (https://www.excelbanter.com/excel-programming/289096-deleting-duplicate-rows.html)

Connie

Deleting Duplicate Rows
 
I've not had success using the macros listed to delete
rows where the first cell is the same. For example,

* Sheet1 has name in column 1 (shorter file)
* Sheet2 has name in column 1 and address in column 2
(longer file)

I want Sheet1 to drive the selection of rows in Sheet2,
resulting in a name and address subset file of Sheet2.

Thank you,
Connie



Tom Ogilvy

Deleting Duplicate Rows
 
in sheet2 put a formula in column 3

=if(countif(Sheet1!A:A,A1)0,"Keep","Delete")

You can copy this down the column, then use the Autofilter to extract the
rows you want.

Use the same approach in a macro.

--
Regards,
Tom Ogilvy

Connie wrote in message
...
I've not had success using the macros listed to delete
rows where the first cell is the same. For example,

* Sheet1 has name in column 1 (shorter file)
* Sheet2 has name in column 1 and address in column 2
(longer file)

I want Sheet1 to drive the selection of rows in Sheet2,
resulting in a name and address subset file of Sheet2.

Thank you,
Connie





Connie

Deleting Duplicate Rows
 
Tried your suggestion but it only worked by placing a Keep
in the first row of sheet 2....all other rows said
delete....thanks!

-----Original Message-----
in sheet2 put a formula in column 3

=if(countif(Sheet1!A:A,A1)0,"Keep","Delete")

You can copy this down the column, then use the

Autofilter to extract the
rows you want.

Use the same approach in a macro.

--
Regards,
Tom Ogilvy

Connie wrote in

message
...
I've not had success using the macros listed to delete
rows where the first cell is the same. For example,

* Sheet1 has name in column 1 (shorter file)
* Sheet2 has name in column 1 and address in column 2
(longer file)

I want Sheet1 to drive the selection of rows in Sheet2,
resulting in a name and address subset file of Sheet2.

Thank you,
Connie




.


Tom Ogilvy

Deleting Duplicate Rows
 
It works fine for me and should work for you. I suspect your problem lies
with your data not matching. Possibly you have blanks spaces on the end of
your data in one sheet or the other.

--
Regards,
Tom Ogilvy

Connie wrote in message
...
Tried your suggestion but it only worked by placing a Keep
in the first row of sheet 2....all other rows said
delete....thanks!

-----Original Message-----
in sheet2 put a formula in column 3

=if(countif(Sheet1!A:A,A1)0,"Keep","Delete")

You can copy this down the column, then use the

Autofilter to extract the
rows you want.

Use the same approach in a macro.

--
Regards,
Tom Ogilvy

Connie wrote in

message
...
I've not had success using the macros listed to delete
rows where the first cell is the same. For example,

* Sheet1 has name in column 1 (shorter file)
* Sheet2 has name in column 1 and address in column 2
(longer file)

I want Sheet1 to drive the selection of rows in Sheet2,
resulting in a name and address subset file of Sheet2.

Thank you,
Connie




.





All times are GMT +1. The time now is 06:17 PM.

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