Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DS DS is offline
external usenet poster
 
Posts: 117
Default remove duplicate rows from specific data in a column; excel 2007

I am trying to remove entire rows reletive to duplicate data in one specific
column

for example:

A B C D E F

1 a1 b1 c1 d1 e1 f1
2 a2 * c2 d2 e2 f2
3 a3 * c3 d3 e3 f3
4 a4 b4 c4 d4 e4 f4
5 a5 * c5 d5 e5 f5


so the result I want is to delete all corresponding rows containing
duplicate values in column B. For the example above I would want the program
to delete row 3 and 5 because row 2, 3 and 5 contain the same value (leaving
2 as the remaining unique data of *) of *.

I have about 4,000 rows that contain only ONE column of duplicate values yet
the delete duplicate values feature is not deleting the entire rows that
contain the specific duplicate value in the selected column. Selecting all
rows or select all does not fix the problem.

To clarify, the duplicate values in the column that I want to use to trigger
the program to delete the entire row(s) do not correspond with duplicate
values across the row itself.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default remove duplicate rows from specific data in a column; excel 2007

hi,

Right click your sheet tab, view code and paste this in and run it

Sub sonic()
Dim myrange As Range
lastRow = Cells(Rows.Count, "B").End(xlUp).Row
For r = lastRow To 2 Step -1
If Cells(r, 2).Value = Cells(r - 1, 2).Value Then
Cells(r, 2).EntireRow.Delete
End If
Next
End Sub

Mike

"DS" wrote:

I am trying to remove entire rows reletive to duplicate data in one specific
column

for example:

A B C D E F

1 a1 b1 c1 d1 e1 f1
2 a2 * c2 d2 e2 f2
3 a3 * c3 d3 e3 f3
4 a4 b4 c4 d4 e4 f4
5 a5 * c5 d5 e5 f5


so the result I want is to delete all corresponding rows containing
duplicate values in column B. For the example above I would want the program
to delete row 3 and 5 because row 2, 3 and 5 contain the same value (leaving
2 as the remaining unique data of *) of *.

I have about 4,000 rows that contain only ONE column of duplicate values yet
the delete duplicate values feature is not deleting the entire rows that
contain the specific duplicate value in the selected column. Selecting all
rows or select all does not fix the problem.

To clarify, the duplicate values in the column that I want to use to trigger
the program to delete the entire row(s) do not correspond with duplicate
values across the row itself.

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
excel 2007 and creating duplicate rows in a spreadsheet? Edward Letendre Excel Discussion (Misc queries) 1 October 11th 07 02:30 PM
Excel 2007 - need to mark, not remove, duplicate records. DDAI Consult Excel Discussion (Misc queries) 4 August 22nd 07 07:50 PM
Remove duplicate rows based on 1 specific criterion Sweepea Excel Discussion (Misc queries) 5 August 30th 06 04:28 PM
How can I automatically remove duplicate data within a column? MECG Excel Discussion (Misc queries) 1 June 1st 05 12:22 AM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM


All times are GMT +1. The time now is 07:31 PM.

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

About Us

"It's about Microsoft Excel"