Deleting Duplicate Rows
I am totally new to macros and would like some assistance on a macro that
will look at a column of data and when it finds a duplicate, delete the entire correspnding row. I've searched through the group and found ones that will delete just one of the 2 or more rows but I need them all deleted. Here is an example To start with: 1 data 1 1 2 data 3 data 3 4 data 5 data 5 5 and end with: 2 data 4 data Thanks in advance for any help you can provide. |
Deleting Duplicate Rows
You don't need a macro.
In B1, add =IF(COUNTIF(A:A,A1)1,"Dup","") Then put an autofilter on column B and filter to True Delete all visible rows. -- HTH Bob Phillips "RMort" wrote in message ... I am totally new to macros and would like some assistance on a macro that will look at a column of data and when it finds a duplicate, delete the entire correspnding row. I've searched through the group and found ones that will delete just one of the 2 or more rows but I need them all deleted. Here is an example To start with: 1 data 1 1 2 data 3 data 3 4 data 5 data 5 5 and end with: 2 data 4 data Thanks in advance for any help you can provide. |
Deleting Duplicate Rows
This would be useful for me too. This is what I got:
Col A Col B 1 data 1 Dup 1 Dup 2 data 3 data 3 4 data 5 data 5 Dup 5 Dup 1) I don't see how to filter on True, and 2) I don't think it will give the result he requested and end with: 2 data 4 data "Bob Phillips" wrote: You don't need a macro. In B1, add =IF(COUNTIF(A:A,A1)1,"Dup","") Then put an autofilter on column B and filter to True Delete all visible rows. -- HTH Bob Phillips "RMort" wrote in message ... I am totally new to macros and would like some assistance on a macro that will look at a column of data and when it finds a duplicate, delete the entire correspnding row. I've searched through the group and found ones that will delete just one of the 2 or more rows but I need them all deleted. Here is an example To start with: 1 data 1 1 2 data 3 data 3 4 data 5 data 5 5 and end with: 2 data 4 data Thanks in advance for any help you can provide. |
Deleting Duplicate Rows
nevermind, I think I took the example too literally. If he meant this, then
it worked 1 data Dup 1 data Dup 1 data Dup 2 data 3 data Dup 3 data Dup 4 data 5 data Dup 5 data Dup 5 data Dup "Bob Phillips" wrote: You don't need a macro. In B1, add =IF(COUNTIF(A:A,A1)1,"Dup","") Then put an autofilter on column B and filter to True Delete all visible rows. -- HTH Bob Phillips "RMort" wrote in message ... I am totally new to macros and would like some assistance on a macro that will look at a column of data and when it finds a duplicate, delete the entire correspnding row. I've searched through the group and found ones that will delete just one of the 2 or more rows but I need them all deleted. Here is an example To start with: 1 data 1 1 2 data 3 data 3 4 data 5 data 5 5 and end with: 2 data 4 data Thanks in advance for any help you can provide. |
Deleting Duplicate Rows
Actually I think my example was misunderstood
I need it to delete all the rows were the number has a duplicate in the column below it. Start with: Number Date 123456 01/21/05 123456 123456 234567 03/25/05 234567 345678 12/11/04 456789 09/19/04 456789 567890 04/26/05 End With: Number Date 345678 12/11/04 567890 04/26/05 The application for this is I'm trying to prep some information for Data Entry. Lets say I have Database A which is information that needs to be Data Entered. Database B is the information that already has been entered. I have a worksheet that is generated from a Database A, I then have to run a query in Database B to see in any of the numbers in column A match. I then plug that information into the worksheet and delete the duplicate rows. At times there are 1000's of records, so I was looking for a way to automate it. Is this possible? Thanks, |
Deleting Duplicate Rows
Your data does not match the description. My original formula in C2 down
still works. -- HTH RP (remove nothere from the email address if mailing direct) "RMort" wrote in message ... Actually I think my example was misunderstood I need it to delete all the rows were the number has a duplicate in the column below it. Start with: Number Date 123456 01/21/05 123456 123456 234567 03/25/05 234567 345678 12/11/04 456789 09/19/04 456789 567890 04/26/05 End With: Number Date 345678 12/11/04 567890 04/26/05 The application for this is I'm trying to prep some information for Data Entry. Lets say I have Database A which is information that needs to be Data Entered. Database B is the information that already has been entered. I have a worksheet that is generated from a Database A, I then have to run a query in Database B to see in any of the numbers in column A match. I then plug that information into the worksheet and delete the duplicate rows. At times there are 1000's of records, so I was looking for a way to automate it. Is this possible? Thanks, |
All times are GMT +1. The time now is 01:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com