Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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,


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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,



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting duplicate rows Ranju Excel Discussion (Misc queries) 1 January 28th 09 12:14 PM
deleting duplicate rows Jess Excel Discussion (Misc queries) 3 January 9th 07 11:16 PM
Deleting Duplicate Rows AllenR2 Excel Programming 4 September 11th 04 06:01 PM
Deleting duplicate rows.....there's more Fredy Excel Programming 1 June 24th 04 07:04 PM
Deleting Duplicate Rows Connie Excel Programming 3 January 25th 04 09:00 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"