Delete Duplicate Rows If 3 Conditions Are Same?

Jul 1, 2012

I have a sheet caled "Data", with thousands of rows.

I want to delte any rows that have duplicate rows only if the following data is in the same row but if in column A, coloumn C and column H have the same data

A B C D E F H I
w 1 1 3 4 5 6 7
e 1 1 1 3 4 5 8
w 2 1 5 2 5 6 7

The last row would need to be deleted as dupilcates are A C and H

The data is not sorted.

View 3 Replies


ADVERTISEMENT

Delete Duplicate Rows When Two Conditions Are Duplicated

Jan 14, 2008

Each task in my spreadsheet has multiple jobs assigned to it. Frequently users will work two jobs for the same task simultaneously and log the time together.

Unfortunately when I go to try to sum up how much time was spent on each task, this causes it to appear as if the task took twice (or even twenty+) times as long as it truly did.

I want to be able to figure out the time spent on each task for each user. In order to do this, I need to get rid of rows where the task id and the user id are both duplicated in another row.

Ex: ...

View 4 Replies View Related

Delete Duplicate Rows :: Duplicate Company Names

Dec 11, 2008

I have a spreadsheet with 3300 rows. In column A there is a list of company names and in column H there is a corresponding Sales Rep name.Column A has many duplicate company names. I would like to run a macro that will find the a company name and then delete all the rest of the rows that contain that same company name.

Attached is a sample of that spreadsheet.

View 5 Replies View Related

Delete Duplicate Cells Or Rows With A Duplicate Cell

Nov 1, 2007

I feel as though I have spent enough time searching the previous posts to ask this question.

I have a 4 column sheet, column B has many cells with identical data. I want to delete all the rows that that have duplicate data in column B.

COLUMN A= Car Makers
COLUMN B= Models of cars
COLUMN C= color
COLUMN D= owner

I want to end up with rows that each contain unique info in COLUMN B.

View 9 Replies View Related

Sum Duplicate Values Then Delete Duplicate Rows

Jan 5, 2004

I have 4 columns in my spreadsheet. I am trying to find any duplicates that may exist in Col A, sum values in Col D, then delete the entire row. So far my sheet before I run my vba code is this.

Col A
100
101
102
105
100
101
102
105

Col D
5
4
2
4
1
2
3
1

After my code is run, I need for my spreadsheet to look like this

Col A
100
101
102
105

Col D
6
6
5
5

I have some code but I still need to do a considerable amount of tweaking to it. Currently my code is only deleting the duplicate values in Col A. I am having difficulty summing the values in Col D as well as deleting the entire row.

Here is my code thus far....

-------
Public Sub FindDuplicates()
For RwCnt = 1 To (Worksheets(1).Cells(65536, 1).End(xlUp).Row)
SrchValue = Worksheets(1).Cells(RwCnt, 1).Value
If Len(Trim(SrchValue)) > 0 Then
With Worksheets(1).Range("a1:a" & Cells(65536, 1).End(xlUp).Row)

[Code]....

View 9 Replies View Related

Sum Duplicate Values Then Delete Duplicate Rows

Jan 5, 2004

I have 4 columns in my spreadsheet. I am trying to find any duplicates that may exist in Col A, sum values in Col D, then delete the entire row. So far my sheet before I run my vba code is this.

Col A
100
101
102
105
100
101
102
105

Col D
5
4
2
4
1
2
3
1


After my code is run, I need for my spreadsheet to look like this
Col A
100.........................

View 9 Replies View Related

Delete Rows On Conditions

Apr 25, 2009

I would like to delete rows that are based on these conditions:

First ,Do a loop from row 2 to last available row
- Delete rows with same column(column B) that has the same value. However I want the last available row with the same ID to remain.

- Delete Rows with any values in found in other sheet column B. When the value taken from the first sheet(ABC) is compared to the column B in second sheet(DEF), if they are equal, the row will be deleted in the second sheet and the rows in first sheet will main.

The comparsion of ID are compared between sheet ABC and sheet DEF
(the Highlighted are those rows to be deleted based on those conditions)
The final outcome are shown on col H I J for sheet ABC and col I J K for sheet DEF.

ABC

ABCDEFGHIJ1QtyProduct

QtyProduct
2100111Case 1

100222Case 33100222Case 3

50333Case 1450333Case 1

57444Case 3557444Case 3

150666Case 26200555Case 1

100111Case 17150666Case 2

100888Case 38100111Case 1

231999Case 19100888Case 3

200555Case 110231999Case 1

100112Case 411200555Case 1

100113Case 112100112Case 4

100114Case 2 13100113Case 1

100115Case 114100114Case 2

View 9 Replies View Related

Consolidate Matching Rows And Delete Duplicate Rows?

Feb 20, 2008

I am working with timesheet data (name, project code, task code, date, hours etc...) in one spreadsheet and rate card data (name, role, day rate etc...) in another.

My task is to pull together some of the information in each of these two source spreadsheets and compile a report. This I have done no problem. However, where a person works on a particular project and task on the same day and records multiple entries (which could be negative) I need to consolidate the hours in all these matching rows and have just one row reflect the total hours worked and delete the other duplicate rows.

So an example would be:

Project | Task | Name | Role | Date | Hours

123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | 2.5
123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | -2.5
123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | 3.5

[Code]....

My problem is I don't think I have approached this the right way but am unsure of where to go with it. The code as is does sort of work but I still get some duplicate and zero lines in my results.

View 4 Replies View Related

Consolidate Matching Rows And Delete Duplicate Rows

Feb 20, 2008

I am working with timesheet data (name, project code, task code, date, hours etc...) in one spreadsheet and rate card data (name, role, day rate etc...) in another. My task is to pull together some of the information in each of these two source spreadsheets and compile a report. This I have done no problem. However, where a person works on a particular project and task on the same day and records multiple entries (which could be negative) I need to consolidate the hours in all these matching rows and have just one row reflect the total hours worked and delete the other duplicate rows. So an example would be:

Project | Task | Name | Role | Date | Hours

123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | 2.5
123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | -2.5
123456 | 1.001 | Paul Jones | Project Manager | 20/02/2008 | 3.5
123456 | 1.001 | Jo Brown | Developer | 20/02/2008 | 7.5
123456 | 1.001 | Jo Brown | Developer | 20/02/2008 | -7.5
123456 | 1.001 | Sam Smith | Architect | 20/02/2008 | 7.5

Should be processed and come out like this:.......................

View 2 Replies View Related

Delete Rows, Multiple Conditions

Jul 20, 2009

I need help with the following conditions. I have attached a sample file with desired results.
Conditions required to delete row:

1Delete Row when cell E is blank (example: Row 6 will be deleted as E6 is blank)
2First character in column 'C' is an alphabet (for example: Row 5 will be deleted as the first character in the cell is an alphabet
3First character in column 'B' is an alphabet (for example: Row 29 will be deleted as the first character in the cell is an alphabet

Special Notes : All characters in column 'B' are not in number format (ex: 555-9999 is general)
There are more than 1500 rows of data that need to be sorted with the above conditions.

View 9 Replies View Related

Delete Rows Based On Two Conditions

Mar 29, 2012

I need a macro that loops through all rows (With the exception of the first row) and looks for two conditions. If those two conditions are met, I'd like for it to delete the row.

The first condition is if Column O does not contain a certain phrase "VTX" VTX isn't the complete value of the column, it might just be contained within a few other notes in that column.

The second condition is if Col S equals "COMPLETE/FOLLOW-UP IMAGING".

So if these two conditions are met, Col O does not contain the word "VTX" and Col S equals "COMPLETE/FOLLOW-UP IMAGING", then that row should be deleted.

View 9 Replies View Related

Delete Multiple Rows Under Certain Conditions

Aug 1, 2008

I need to eliminate the passing jobs, leaving the failing ones so I can do coaching sessions with the guys that are missing the mark.

Conventions of the report:

Each job has a 20 digit job # and is allocated 12 rows worth of information fields unless customer has more than 1 cable outlet with a modem, then the rows increase by 4 for each additional modem
Tech name is repeated after every 12 rows even if within the same job #
On passing jobs, column I will only contain “Yes” (there are blank cells in column I, as not every parameter is checked on every job), failing jobs will contain “No” in column I

Items I need to accomplish:

· Increase column C width to 22 and column E to 25

· Format column C to number, 0 decimal places (to avoid scientific notation)

· Move tech name to beginning of each job # and eliminate repeated names

· Delete all rows plus tech name on passing jobs

· Change cell color to red in rows (columns A-I) that contain “No” in column I

I have highlighted each different job # in different color


John Smith10002934422610200000Outlet 2D - Up Stream SNR274029.4Yes10002934422610200000Outlet 2D - Up Stream Tx365546Yes10002934422610200000Outlet 2D - Down Stream .............................

View 10 Replies View Related

VBA To Delete Duplicate Rows?

Aug 18, 2012

VBA code that will delete all the rows where cell "C" is duplicated

I have look on the net and there is loads of complicated codes out there but I am looking for something fast.

View 2 Replies View Related

How To Delete Duplicate Rows

Jan 23, 2014

I am trying to delete duplicate rows and have had some success using a VBA from MR Excel threads. However, i would like to add multiple sheets to be compared. When i change the vba to use array, the next line fails with error 438, not a supported objectproperty method.....

Here is the code:

Sub CheckWest()
Dim LR As Long, i As Long
With Sheets("west")
LR = .Range("C" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsNumeric(Application.Match(.Range("C" & i).Value, Sheets("Removals").Columns("C"), 0)) Then .Rows(i).Delete
Next i
End With
End Sub

This checks the sheet "removals" column "c", any duplicates found in sheet "west" column "c", row is deleted. I would like to add additional sheets, how to correctly change this line of the VBA?

With Sheets(array("west", "east", "north"))?? I beileive this is what i tried and the next line errored.

View 9 Replies View Related

How To :: Delete Duplicate Rows?

Mar 21, 2007

How would I go about deleting duplicate rows?

I've searched the board already and I couldn't find this.

I have a sheet with different data in each column, song titles, writers, owners and so on.

say this information runs from column A to H down 10,000 rows, occasionally information is duplicated in certain rows, except for column A.

I need to be able to search the sheet and delete any extra rows that are duplicated.

So I'll end up with the exact data in each row only appearing once.

View 9 Replies View Related

Vba To Delete Rows Based On Certain Conditions In Column A

Mar 2, 2006

I have a report in which I need to delete the entire row for each cell in Column A that has the name "Defacto" in a certain location in that cell. I am trying to use VBA code in conjuction with the "MID" function [i.e., Mid(Cell.Value, 8, 7) = "Defacto"]. This is the code I came up with (but, obviously, it doesn't work):

Sub DeleteRowOnCondition()
Range("A2").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
For Each Cell In Selection
If Mid(Cell.Value, 8 , 7) = "Defacto" Then Rows.Delete
Next Cell
End Sub

As well, there is another worksheet in the same report in which I need to delete all the rows that do NOT meet that condition (while retaining the ones that do).

View 9 Replies View Related

Delete Both Original And Duplicate Rows?

May 25, 2014

My worksheet that will have duplicate data inserted into it. Once inserted I need to delete the new duplicate row and the row it duplicated. The attachment is a copy of what the data looks like with the first tab showing what it will look like with inserted data and the second tab is what I want it to look like at the end. I will not need the deleted data again so it does not need to be on a new sheet, that is just for an example. The name of the tabs will also be different so I want to be able to run it on any worksheet. This is the code I am using to find and delete the duplicate but I can't get it to delete the original. I used "First, MI, Last, and DOB" because those are the ones that won't be duplicated where others will. This is a list of about 15,000 entries. There should never be an incident where there is triplicate data but I can't say for sure.

[Code] .....

Attached File : Practice.xlsx‎

View 2 Replies View Related

Delete Duplicate Rows, With A Twist

Dec 4, 2008

I can delete duplicate rows easily enough, but I can't seem to capture a couple variables where I would not want to delete the selected row. There are no headings, all data starts in Row 1.

I start in Row 1 Columns C and D, compare that to Row 3 Columns C and D (Every other row). If it is a duplicate entry in both columns, delete that row and the row below it. Pick up at next row and continue. See attached Excel file (Excel 2003). The rows with fonts colored RED are the only rows from this data that should get deleted.

View 2 Replies View Related

Delete Duplicate Rows Vb Needs To Run On All Worksheets

Apr 20, 2009

Hi i have the below code which runs on deleting duplicate code which i found in an excel manual. I am having some trouble as i want to convert the code so that it will run on all worksheets i have which are numbered such as 1,2,3,4 etc.

This is so it makes the workbook easy maintenance for when deleting or adding worksheets which happens quite regularly.

View 7 Replies View Related

Delete Rows With Duplicate Values

May 1, 2006

I have a spreadsheet with three colums of data. The first column contains
records which have occasional phone number duplication- see blelow:

(555) 000-0000DataA1ValueA1
(555) 000-0000DataA2ValueA2
(555) 555-9770DataA3ValueA3
(555) 555-4464DataA4ValueA4
(555) 555-4464DataA5ValueA5
(555) 555-4720DataA6ValueA6
(555) 555-8823DataA7ValueA7
(555) 555-3834DataA8ValueA8
(555) 555-4125DataA9ValueA9

What I need to do is (somehwhat) automate the process of filtering or
deleting out all rows which have duplicate data in the first column, but not
second or third columns. I'm sure it's been done...I tried the Excel
out-of-the-box.

View 14 Replies View Related

Delete Duplicate Rows Keep The One With Highest Value?

Aug 5, 2012

I need to delete duplicate rows in the "Description" column but keep the highest number in the "Order" column. In addition, I need to combine the duplicate amounts for (Budget, Commit, PTD, Avail) into the one line item that is left after removing the duplicates. This is what the spreadsheet would look like initially:

Order
Description
Budget
Commit

[Code]....

View 6 Replies View Related

Remove Or Delete Duplicate Rows

Aug 24, 2008

I have 6 columns on my data sheet. F column is Amount column.

If there are rows where all the columns A,B,C,D and E duplicate then I need that row to be deleted, BUT before that the value from the column F should be summed to the duplicating row's F column.

I attached a simple example file, where you can see my point better. (I need the code to work with thousands of rows, and not only with 5 rows which i put on the axample)

View 9 Replies View Related

Delete Duplicate Rows With Condition

Nov 1, 2006

how to delete duplicate rows except the first and the last rows using macro..

I have data like this and i want to delete those rows except the first and the last rows

31/10/2006
31/10/2006
31/10/2006
31/10/2006

I use the below macros from btadams posted 27th January 2003 but only for delete the last row

Sub DleteDups()
Dim Cell As Range

Do While ActiveCell.Offset(1, 0) <> ""
If ActiveCell.Value <> ActiveCell.Offset(1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.EntireRow.Delete
End If
Loop
End Sub

View 9 Replies View Related

Delete Duplicate Rows Without Having To Look Manually

Apr 10, 2007

I have 4 colums of data (A2:D5684) with the data sorted ascending by column A. I would like to delete the rows with duplicate information without having to manually look through the 5684 lines.

View 5 Replies View Related

Delete Duplicate Rows Including 1st Row

May 16, 2007

delete duplicate rows and leave only the LAST row. The codes I have seen leave the first row.

View 9 Replies View Related

Delete Duplicate Rows In Table

Jul 6, 2007

I would like to achieve is a Yes there are Duplicates & NO there aren't any in Column H. If Column A,B,C,D & E ALL Match & there is another Row that Exactly Matches A,B,C,D & E Then Return a YES or NO in Column H. Though I DO WANT ONE ROW TO STAY as I will Delete the Rest of the DUPLICATES.

View 3 Replies View Related

Delete Duplicate Rows Leaving 1

Oct 19, 2007

The problem is a little complex, I have a large spreadsheet (10,000+ entries) and a smaller spreadsheet (100 or so entries). I merged them together, and now I need to find a way to delete all rows that are unique.

Reasoning: I accidentally deleted a few hundred product orders from our system, and need to find a way to re- import them from a backup SQL dump we have, but not the whole table

View 9 Replies View Related

Delete Duplicate Rows Code ...

Jun 4, 2008

I have trouble in deleting the duplicate rows. I have a code to find the duplicate values

Public Sub Unique_Proj() 'This is the first step which takes out the unique projects from the base data
'Call Work_Assignment
'this selects the unique projects in the sheet
Application. ScreenUpdating = False
Dim A, E, B(), n As Long
Sheets("Projects").Select
With ActiveSheet
A = . Range("g2", .Range("g" & Rows.Count).End(xlUp)).Value
Redim B(1 To UBound(A, 1), 1 To 1)
With CreateObject("Scripting.Dictionary")
.CompareMode = vbTextCompare
For Each E In A
If Not IsEmpty(E) And Not .exists(E) Then
n = n + 1: B(n, 1) = E: .Add E, Nothing
End If
Next
End With
Sheets("Unique Projects").Select
Range("G3:G" & Rows.Count).ClearContents
Range("G3").Resize(n).Value = B

End With
Application.ScreenUpdating = True
End Sub

However, this gives me a list of values in that perticular column only.

What I want is either delete the complete row which is duplicate OR select the entire range of values which are unique (based on the column searched) and paste it in a new sheet. The second option is more better for me.

View 7 Replies View Related

Identifying Rows To Delete Based On Multiple Conditions?

Jun 5, 2014

Maybe this has been taken care of in another thread, but still:

ROW ID NUM OCC K OCC I
1 222222 0 0
2 222222 0 0
3
4 333333 0 0
5 333333 0 0
6 333333 0 0
7
8 444455 1 1
9 444455 1 1

I have a situation like above, but what I want to do is:

=FOR(ROW1:ROW9, IF COUNT ROWS(ID_NUM)>= 2,

(create name for set?)

AND

IF OCC_K AND OR OCC_I VALUES >= 0,

THEN DELETE ROWS(within set) >=2

Or more simply:

If there are rows with multiple Accident ID numbers, name that set,
and if OCC_K and/or OCC_K values are BOTH >= 0,
then delete all duplicate rows?

Yes I figure there needs to be some way to distinguish Row 1 from Row 2, (flagging one of the two?) so that ROW 2 can be identified, and similarly with Row 4 from Row 5 from Row 6, but the general flow of commands is what I'm trying to get at.

Is it also possible to use AND and OR in the same line? Or BOTH?

(I have other variations on this that I also like to ask about, such as multiple rows within a set that meet certain conditions that are identified in a different field, but for now this is a simpler version.)

I would like to think I'm not going to need a macro, and that I can do this in a Formula.

View 10 Replies View Related

Delete Duplicate Rows Depend On Criteria On Col A And Col B

May 28, 2013

I got 2 sheets one with Employees name in col A number of hours worked in col B. Second sheet is download form time clock which has Name in Col A and Hours worked in Col B and other details in other columns. I want MACRO to delete matching rows depend on Col A and Col B .

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved