Deleting Duplicate Cells (not Entire Rows)
Dec 17, 2007
I have a long list (over 1000 lines) of numbers, some of which are duplicated. Up to now I have been sorting them, adding in a simple check column to see if the number is a duplicate of the one below, and then manually deleting this cell.
Is there a better way to do this using VBA? The only way I have managed to find is by deleting the entire row, but I cannot do this as I have additional data to the right that I need to keep.
I also cannot install any add-ons as this on a work computer.
View 9 Replies
ADVERTISEMENT
Sep 22, 2008
I have a spreadsheet that I need to delete duplicate rows in. However, in order to determine if a row is a duplicate I need to check 2 cells per row. In the attached file you will see that each row has 4 cells. I need to compare the cells in columns B and C with the B and C cells of the Row beneath. If the B and C cells match then it is considered a duplicate and one of the rows needs to be deleted. Also, there may be multiple duplicate rows.
For an example see rows 17, 18 and 19. I only need 1 row to remain.
I am looking for a vb script that would analyze a file with thousands of rows and delete the duplicates.
View 12 Replies
View Related
Feb 4, 2014
I am looking for some code that will use A,B,C as filters to find duplicate cells, and if duplicate found, there should be deleted the duplicated row (but not only the row from a,b,c column, but the whole 8 cells from that row - A,B,C,D,E,F,G,H).
As filter I would like to be used A,B,C columns.
EXAMPLE:
BEFORE
A B C D E F G H
Kristijan Markovski 26,2,1992 1389 Prilep Prilep Mice Kozar1 1
Kristijan Markovski 26,2,1992 1389 Prilep Prilep Mice Kozar01 1
Kristijan Markovski 26,2,1992 1389 Prilep Prilep Mice Kozar001 1
Bojan Smileski 5,2,1992 1356 Prilep Prilep Borka Taleski 1
AFTER
A B C D E F G H
Kristijan Markovski 26,2,1992 1389 Prilep Prilep Mice Kozar1 1
Bojan Smileski 5,2,1992 1356 Prilep Prilep Borka Taleski 1
View 1 Replies
View Related
Aug 29, 2007
I've been tasked with developing a macro that will generate schedules. For background, we're taking a QuickBooks Customer file and exporting it to be picked up by the macro. I've got that part working, but now I need to delete various rows based on certain criteria.
The spreadsheet has a field for Job Status which we use to define whether an account is under contract (2 in QuickBooks), or some other status. Basically what I need to do is delete the entire row of data where JobStatus (Column R) is anything but 2.
View 9 Replies
View Related
Feb 2, 2014
The below code compares the Data in a Field that must be set and collect the duplicate Values in a second Worksheet.
The thing I want it to copy the rows, when a duplicate is found in Col A. editing the code below:
Original Sheet:
"A" "B" "C" "D"
Teil1A11000
Teil1B21001
[Code]....
View 7 Replies
View Related
Nov 24, 2011
I've got a report which is approx 40,000 rows long and I need to delete out alot of the info.
I need to delete out entire rows if column C contains a 0.
I've written a loop to do this but as theres so much data it take a long time to run.
Is there a smarter way to do this?
View 6 Replies
View Related
Oct 14, 2009
In my Excel 2003 worksheet I need a macro to search column B for duplicate entries. The data in column B is both numeric and string. If there are any duplicate entries, then I need the duplicate rows to be deleted.
View 4 Replies
View Related
Aug 5, 2007
I deal with leads for a sales room and get sent over leads in bulk, I've created a master scrub list that I can attach to the end of a new lead file and sort by number to show which are duplicates.
When you do the: Data, Filter, Advanced Filter, select Unique Records, it hides the duplicate but what I need is not only for the duplicate to be hidden or gone but the row that it is a duplicate of, i.e. I need BOTH rows to go
Name-----number
Dave 555-1212
Dave 555-1212
John 536-2343
Smith 423-2312
needs to become
Name-----number
John 536-2343
Smith 423-2312
I would need a formula that figured out that Dave with number 555-1212 was a duplicate and delete BOTH rows,
View 10 Replies
View Related
Mar 16, 2013
I am trying to delete entire row that has certain text, let say "hi". I was able to delete cells with exact word "hi", but was not able to delete cells that have texts other than "hi". ex) "hi myname." Below is my vba code, and I keep getting run-time error and cannot execute the code.
VB:
Sub HiDelete()
Dim srchRng As Range
Set srchRng = ActiveSheet.Range("g:g")
For i = srchRng.Rows.Count To 1 Step -1
If worksheefunction.Search("hi", Cells(i, 7)) > 0 Then Rows(i).Delete
Next i
End Sub
View 3 Replies
View Related
Feb 25, 2014
I'm trying to put together a script which on the sheet "Resource" compares every cell in the range B:U, starting at row 8, and where all cells match, keep the first row, but delete the duplicate proceeding rows.
I've found the code below here: [URL] ...., which I thought I may be able to adapt, but for me to include all the columns in the 'If.Evaluate' section of code seems to perhaps not the most efficient way of doing this.
[Code] ......
View 5 Replies
View Related
Aug 8, 2007
I found a useful resource on the web that gives a macro that deletes rows when the cells within a SINGLE column are identical. [url]
Does anyone know of a macro that can do more than that, one that will delete rows if ALL cells within ALL columns are identical?
For example, the macro should delete row 4 of the attached spreadsheet. It should leave row #2 there because it's the orginal row. But the duplicate row #4 should be deleted. The macro should leave row #5 there because not all columns are identical for that row.
View 9 Replies
View Related
Aug 6, 2012
I have a sheet whereby in column A i have company names and column B how much is invested in this company so:
A B
AAPL 10
GOOG 5
MSFT 15
APPL 5
IBM 20
GOOG 10
What i would like to do via macro is take all the duplicates sum them so that i see AAPL as 15 but only be left with one row. So we would be left with only 4 rows each with their summed weight.
View 9 Replies
View Related
Jan 16, 2008
I have many rows that contain some common data but I need to be able to select the row with the most recent data and delete the others. For example, a car part is assigned a unique number which never changes, it may be ordered several times and in different quantities, for each car part I want to select the most recent order and delete any others. Is there a simple way of doing this?
View 9 Replies
View Related
Jun 26, 2009
In Column "C" there is a list of numbers ( these number realte to incidentsm and are called incident IDs) and I want to delete the rows that have duplicate incident IDs.
the row of numbers looks like this ....
View 9 Replies
View Related
Nov 28, 2013
I have a sheet with 45,000 rows. Let's say each row has 4 columns: Create_timestamp, Update_timestamp, email_address, and o_flag
Many rows have duplicate email addresses. I would like to remove all the duplicate rows, EXCEPT for the row with the most recent Update_timestamp.
And actually, if I could just "hide" all those rows, that would be even better, but I'd be happy just figuring out how to delete all the "old" rows, so I just have a list of unique email addresses, with their create/update timestamps and o_flag column. Seems like this is such a basic use case for "Remove Duplicates,",.
View 1 Replies
View Related
Jul 30, 2009
I need the macro for deleting duplicate rows only it should keep one lowest value row.
for e.g.
Column A Column B
TS1234 100
TS1234 50
TS1234 200
Macro will compair dublicates in column A & it will keep lowest value row (i.e. 50 value in Column B), other dublicate rows will be deleted.
View 12 Replies
View Related
Mar 19, 2014
Below is an example of an Excel sheet I'm working with: [URL]
Basically, I'm trying to delete the duplicate rows by matching ID, Date and Type. If ID, Date and Type are the same, then, I want to only keep the record with the earliest Time in case of Type = In and the latest Time in case of Type = Out.
So, for example, in the case of ID = 1, there are 3 records for In, I only want to keep the one where Time is: 8:01 as this is the earliest. The other 2 records should be deleted.
Similarly, in the case of ID 3, I want to keep the record where Time = 18:05 as this is the later time out of the 2.
Can this be achieved by Conditional Formatting or Macro or VBA?
View 1 Replies
View Related
Sep 23, 2013
I have an excel work book with 6 tabs. I would like to have Excel move an entire row from one tab to another tab (removing the row and inserting it in the other tab). I.e. Example I have a tab with items that are marked as "Open Actions" so if I were to change the drop down to close. Excel would move that entire row of actions to the tab with the "closed actions" and insert into the next available row. Now if someone were to come back at a later date say no it should be reopened than I would change the drop down to open and excel would move that row back to the open actions tab into next available row. I tried a PIVOT table and no good I played with few macro and not.
View 5 Replies
View Related
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
Aug 19, 2014
I have a worksheet that has 3 duplicate values in a particular column, I need a macros that will highlight two of the duplicates row and then another macro to delete the entire row. The duplicate element are in column R. find attached worksheet.
Copy of OCL 2010 (3).xlsx‎
View 1 Replies
View Related
Apr 14, 2014
I am new to macro and just trying to learn. I have a spreadsheet with 20000 rows and 8 columns. I am trying to identify equal rows based on the values of columns C, D, E and F. then I need to separate equal bunches with a blank row. Then I need to copy the ID number from the first cell of column B of each bunch and paste it for the rest of the rows in that bunch. I have written the following code but this does not put the ID of the first cell in a bunch for the rest of the rows in that bunch.
[Code] .........
View 10 Replies
View Related
Sep 1, 2008
I am trying to a method to delete rows that contain EL or LE in a specific cell in a set column as this will reduce my file down by nearly a third. Currently by doing it using a autofilter it kills my computer as there is so much data. Is there an easy way to reduce this?
Trade ID456465ELColumn B456456LE Column B8454321LEColumn B456456ELColumn B5464564LColumn B4564546LEColumn B
View 9 Replies
View Related
Dec 5, 2008
I have a project that needs to be done today. What I'm trying to do is hide an area of a worksheet using a button click, then display that area when the button is clicked again. This area is approximately the lower right quadrant of the worksheet, so it shares column and row information with other data that must remain visible. Is there any way to do this?
Alternatively, I was thinking about making a duplicate of the worksheet, but omitting the area I want to hide on the duplicate sheet. The button would then hide and unhide the two worksheets, hopefully making it have the same effect as hiding or unhiding just that area. If I do this, I would need to maintain the exact same data in the visible area of the two sheets.
View 13 Replies
View Related
Apr 8, 2014
I have a normally easy task that is causing me some grief. In column f of my data I either have a number or this "____________". My goal is to delete the entire row if that line is present but my code is not finding that value in my range.
I am wondering is this some format value or something, but it shows up in the formula line as a line. Doesn't appear to be an underline, but I could be wrong. Below is my code.
[Code] ........
View 9 Replies
View Related
Dec 24, 2007
I have a spreadsheet with thounsands of rows. Some of the rows I'd like to delete because thier values are below 5%. I wrote a VBA code, which primary function is to look for a cell and delete the row if the value is less than or equal to 5%. The code looks fine but I get an "Infinite Loop" anytime the first row value is not true. Below is the code,
-jungleman1
Sub Delete_Zero_Factors()
Dim i As Integer
Dim CUSIP As String
Sheets("Report").Select
Range("B5").Select
i = 0
While Not (IsEmpty(ActiveCell.Offset(i, 0).Value))
CUSIP = ActiveCell.Offset(i, 0).Value
Do While (ActiveCell.Offset(i, 1).Value
View 9 Replies
View Related
Mar 5, 2009
I'd like help in creating a macro that deletes an entire row that has emtpy cells in col B, C & D in the same row.
So for example if I have empty cells in b3,c3 & d3 I'd like the row deleted.
I've used the code below for just column B but I need to include column C & D as well. I tried putting Columns("B:D") but it deletes everything.
View 14 Replies
View Related
Oct 27, 2007
Deleting rows that have dependent cells.
I have one sheet that uses a very simple formula for copying certain values from one cell to another sheet “=VALUE(Sheet1!B5)”.
My problem is that rows have to be deleted in sheet1 as the information eventually becomes expired and the following is displayed in my cell in
sheet 2 “=VALUE (Sheet1!#REF!)” Is there a work round this, to prevent the formula showing a #REF! Value.
Row 5 is replaced and the same formula has to be re-entered. Excel 97 used in our office unfortunately.
View 10 Replies
View Related
Nov 29, 2009
I have a column that has different SIC codes in it (00045, 00046, etc). I would like to set up a macro or filter that would take cells in this column and delete each row that contains a certain code that I don't want.
Example, I want to delete all the rows with SIC codes that have 00345, 00873, 00145, etc in a particular cell. I would like a macro that would look at each cell in the column and delete the rows that I don't want.
View 9 Replies
View Related
May 2, 2006
Need the code for deleting multiple columns simultaneously in an excel depending on some search criteria.Suppose I want to delete the columns whose names are "Roll No" ,"Age" & "Class"
View 2 Replies
View Related
Apr 17, 2013
I work with a spreadsheet every week to input values and subtotal them. These values change constantly and instead of going through and manually deleting each row in a 100+ row spreadsheet to be able to import into another program, I'm looking for an quicker way to keep my data in order but consolidate by getting rid of only the rows where both column A and B are blank.
Here's an example of what I'm working with:
5
10
15
20
50
2
4
6
8
20
This is what I need the final product to look like:
5
10
15
20
50
2
4
6
8
20
So I would like to quickly delete rows 2, 5, and 11. All of the other answers I've found only show how to delete rows based on empty cells in only 1 column. How can I quickly delete the rows where both columns are empty?
View 5 Replies
View Related