Delete Entire Rows With Duplicates In Two Columns Only
Apr 20, 2012
I need excel to delete entire rows if there are duplicates in two columns combined.
So, if I have this sample data (in reality I have a lot more columns)
1 Tr. ID Last Name First Name Sex
2 RBM_A Miller Johnny M
3 RBM_A Bayron Josephine F
4 RBM_A Jackson Reynaldo M
[Code] ........
I want excel to delete only row 9, not 11, 13 or 14.
So far, if I look for duplicates in both columns it marks duplicates in either one. Also if I delete the duplicates, it deletes them only in those two columns, leaving me with distorted data (in this example, row 14 would have no last or first name, but only the values "RBM_C" in column B and "F" in column E.
View 2 Replies
ADVERTISEMENT
May 14, 2006
I've been looking through various forums looking for a macro for a particular task, but I have not found something that works yet. Maybe someone could help me out? It's pretty straightforward situation.
I need a macro that removes an entire row when: information in column B and column C are both found in other rows ( duplicates).
I'm dealing with a worksheet with store record information ... Store Name (column B), Street Name (column C), State/Province, etc. I import new store records all the time and many are invalid because they share the same name and street address and therefore need to be removed. The ones that I’ve played with unfortunately end up deleting the cells only and not the entire row.
It's a tedious process to do manually remove entire rows (for duplicate column B&C) when dealing with thousands of rows and I would very much appreciate any assistance or insight into how simplify the process with a macro. I've attached a sample of what I'm working with.
View 9 Replies
View Related
Dec 6, 2006
I want to delete the current row if the data on row A and Row B match. Its hard to explain so I posted an example.
View 5 Replies
View Related
Dec 29, 2011
I have a macro that delete empty cells in a column, what i wanted to do is while deleting the empty cells is that the macro will also delete duplicates in ENTIRE WORKSHEETS. My file has so many sheets so i need a macro that run or loop on my entire worksheets.
This is my code. that only runs in a single sheet.
Code:
Sub deleteblanks()
Columns("H").SpecialCells(xlBlanks).Delete (xlUp)
End Sub
[Code] ..............
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
Jul 17, 2013
I have a excel 2007 workbook that has 5 sheets "MASTER" , "RED" , "WHITE", "GOLD" & "BLUE". There are 7 columns in each sheet and the master has about 8,000 rows . In column D of each sheet there is a unique number (approx. 8 - 10 digits ) that I would like to at the press of a command button search through sheets "RED" "WHITE" "GOLD" & "BLUE" against the unique numbers in the "MASTER" sheet and if there any duplicates numbers delete the entire row but leave all the data in the master sheet.
View 2 Replies
View Related
Aug 19, 2013
I'm having some problem with a part of my code that deletes entire columns. With ActiveCell as my reference, I want to delete 'Abs_Diff' Columns to the left hand side of the ActiveCell column, including the ActiveCell column. 'Abs_Diff' is a variable of integer type.
SO if ActiveCell column is "P" and 'Abs_Diff'=2, then delete Columns "O:P"
if ActiveCell column is "P" and 'Abs_Diff'=4, then delete Columns "M:P"
My code is selecting columns incorrectly, maybe due to merged cells in cols A,B,C or something..not sure.
Here is my code:
Code:
'DELETE COLUMNS
Set StartPoint = ActiveCell
For X = 1 To Abs_Diff
StartPoint.EntireColumn.Delete
Set StartPoint = ActiveCell.Offset(0, -1)
Next X
View 1 Replies
View Related
Aug 22, 2013
I have worksheet, whose snapshot is given under (in reality, there are over 2000+ rows in worksheets)
I want a Macro which can perform following function in entire worksheet used range
Only retain the rows where the cell value in current row is identical BOTH in Column B, as well as column D in its immediate previous row
i.e. B14=B13 and ALSO D14=D13 (both condition should be valid, if not Delete entire ROW, i.e. having unique value)
Normally, ppl wish to delete the duplicates, but i want to retain the duplicate as identical data is of two different dates, control in Column O
My Worksheet looks like - [URL]
View 8 Replies
View Related
Sep 27, 2007
I have Column Headers in Row 1 (except column A), What I need to do is write a Macro or some code to
1.Search the entire row 1 for column headers containing the suffix _CSV and delete the entire columns.
2.Shift all remaining columns to the left so no blank columns exist. (There is a time stamp in row A that I wish to keep where it is.)
Next I would like a separate routine to sort the columns in the order of a Pre-defined list that I specify in a range. For example the list of column headers reside in the Range (A1:A200)
View 9 Replies
View Related
Dec 31, 2008
in a selected columnar range.
I want to write a fairly simple, fast macro to examine a selected range and simply delete the row for each blank cell that it finds in that range.
I have read around that loops aren't necessarily that fast and some of these ranges could be 1000s of rows long...
way to write something like this in VBA?
View 9 Replies
View Related
Mar 29, 2013
I have two columns of data, one with an ID # and the other one with a date. Some ID# + date combinations are repeated and I need to delete the duplicates. Here is a visual:
ID# date
54 19720211
54 19720211
54 19810512
67 19590312
89 19931104
89 19931104
I need to keep only unique ID/date combinations. I would need the final list to look like this:
ID# Date
54 19720211
54 19810512
67 19590312
89 19931104
View 2 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
Nov 21, 2007
Excel Range A1 - D500. Data located in column C. I would like to delete the rows in this spread sheet that do not contain any of the following 3 prefixes of part numbers from column C: X-SXP, X-SCM and X-SBP. There are many part numbers but only parts with these 3 prefixes are needed. Part numbers are 10 characters long after the prefix. If any additional information is needed, let me know.
I viewed the Delete Rows Meeting Conditions thread, but the input value in that code is for what you want to delete, and I need to delete everything not meeting the data I want to keep, which is about 30 different part numbers. Also, that appeared to only offer one input and not 3.
View 3 Replies
View Related
Dec 24, 2009
I have a list of 18k rows, and about 7.5k are known duplicates. The delete duplicates button will not delete the duplicates (except it keeps returning 41 duplicates for an unknown reason, but there definitely thousands more it is missing). I tried the remove duplicates button, advance sort, coloring cells, and some macros. The list is the combination of two lists, one older one just compiled, I was able to seamlessly delete dups in another list.
View 9 Replies
View Related
Oct 7, 2009
I have column A that is 1,500 records.
I have column B with 40,000 records.
Among the 40,000 records in column B, duplicates of ALL 1,500 records from column A exist.
My question is: How do I find WHERE the 1,500 dupes are and how can I delete JUST those records?
View 3 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
Jun 10, 2009
I know it can delete entire rows based on the value of single cell, I just don't know how to do it. So what I need is a macro that will delete an entire row if the value in a particular column = 0.
More details: ....
View 9 Replies
View Related
Jul 20, 2005
I have a sheet of Data containing 3705 rows. It has plenty of duplicates. Column A is where is located the identification. I need to delete the rows that are duplicated, in order to have only one row for each identification number. I tried to create my own VBA macro to do so, but it seems it doesn't delete all the duplicated rows and it seems to even delete unique rows.
Sub Duplicates()
Dim lstRw As Long
Dim i As Long
Dim j As Long
Dim m As Long
m = 1
Dim Compteur As Long
Compteur = 0
Application. ScreenUpdating = False
Let lstRw = Sheets("UE"). Range("A65536").End(xlUp).Row
For i = 2 To lstRw
'With Worksheets("UE")
SumNumber = Range("A" & i).Value.....................
View 5 Replies
View Related
Sep 17, 2007
I need create a macro to perform the following - I don't know if it needs to be an Excel macro or via VB. This is to speed a process up and eliminate any spreadsheet messing around for our "admin" staff - they are not good with excel at all!
So, I have a daily/weekly down load of a spreadsheet (exported from access).
* I want to copy the values of column AK to A
* Then delete all entries in column D that equal 19, 20 and 6
* Then delete all entries in column AL that equal "A","B","C" or "D" but not "E","F" or "G"
* Then delete entire rows where the value in column A is a duplicate within the list
I will call this spreadsheet, for the purpose of this exercise, the "Master". I now have another spreadsheet with values in that should relate to values in either (or both) columns A and B in the "Master". I need Spreadsheet 2 values to be highlighted as cross checked in the "Master" and then all those in the "Master" that do not appear in the 2nd S/S will be normal white cells thus showing that they need to be chased by our Admin staff.
View 6 Replies
View Related
Mar 15, 2009
I have two columns of data, and I need to create a third column to count the number of times that same line appears in the document (and then remove all but the first copy of that line). my data looks as follows (and it is sorted so all duplicate rows appear directly next to each other):
Adam1998 | Jan
Adam1998 | John
Adam1998 | John
Adam1998 | Paul
Adam1998 | Peter
Adam1998 | Peter
Adam1998 | Peter
Adam1999 |John
Adam1999 | Paul
I need this to look as follows:
Adam1998 | Jan | 1
Adam1998 | John | 2
Adam1998 | Paul | 1
Adam1998 | Peter | 3
Adam1999 |John | 1
Adam1999 | Paul | 1
View 2 Replies
View Related
Jun 28, 2007
I have a sheet as shown in the picture below. If the cells in Column N has some values that are the result of some calculations. How ever if there are more than one of it, the entire row has to be deleted.
Eg:The value in Column N 816.323 has 3 rows below each other.Only one has to be there.There can be upto 10 values one after other in this way.
I tried to write a progrma by using loops and cehcking if ther is value in the cell,go to cell below and if there is value,delete the row in a loop of 10 times.But it didnt work
View 6 Replies
View Related
May 4, 2014
i want to delete entire blank row from column C2:C300 i mean if i have data c2:c100 then c101:c300 delete entire blank rows
View 4 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
Mar 16, 2014
I am trying to hide all rows and columns with zero balance in the cells with the use of a macro button.
View 8 Replies
View Related
Mar 25, 2014
I have been trying to find a way of formatting an entire row based on the contents of cells in each column. However i come unstuck when trying to make the column dynamic. Below is an example:
Month
2010
2011
2012
[Code]....
The idea is that i say current year is 2011 and all rows where C contains an a will turn green. What i would like to achieve is that when i change current year to say 2012 the conditional formatting adjusts so that it looks at D instead of C.
View 3 Replies
View Related
Feb 28, 2014
I want to check between column c and E if it has same values repeated more than once.
Same user has same ID twice remove one.
for Ex:
if
c2 has "Ram" and E2 has "sample001".
c5 has "Ram" and E5 has "Sample 001".
highlight the duplicate.
Check this between columns c and E till the last row.
View 1 Replies
View Related
Dec 10, 2008
I have a single spreadsheet with a few columns but hundreds of rows. Each row is a property reference (with other data such as address in the columns) with a type of charge in column J and the amount in column K. I'll try to replicate below ...
A B ....... J K
Prop1 Prop1Address Rent 100
Prop2 Prop2Address Rent 150
Prop3 Prop3Address Gas 70
Prop4 Prop4Address Water 60
Prop4 Prop4Address Rent 200
Prop4 Prop4Address Elec 80
Prop5 Prop5Address Service 90
I want the sheet to display a property on a single row so would look like as follows ...
A B ....... Rent Gas Water Elec Service Total
Prop1 Prop1Address 100 100
Prop2 Prop2Address 150 150
Prop3 Prop3Address 70 70
Prop4 Prop4Address 200 60 80 340
Prop5 Prop5Address 90 90
View 9 Replies
View Related
Jul 15, 2009
1. Remove J,K,N,A Columns,
2. In the last O (TIMESTAMP) column, the date is 14-Jul-09 format change it to 07/14/2009 (this format mm/dd/yyy
3.Filter L column (VAL_INLAKH) Remove all rows from whole sheet which has 0 value
4. Column C (EXPIRY_DT) date format is 24-Sep-09 , "dd-Sep-09" change to "Sep" only
5.Merge Column B,C,D,E (SYMBOL.EXPIRY_DT.STRIKE_PR.OPTION_TYP
respectively )
View 3 Replies
View Related
Dec 2, 2013
I have 7 columns x 3 rows with unique numbers. I wish to determine every combination of the above numbers without repeats.
5
11
17
24
29
35
40
[Code] ........
Column 1 would only use column 1 numbers.
Column 2 would only use column 2 numbers...etc.
Also have the same for 5 rows of unique numbers.
I've been working on this for 10 years and this is the last step to finalizing the WINNING numbers.
Back checking using the 5 row technique I would have spent 10,000,000.00 playing over 8 years with a winners purse of 33,000,000.00
With the 3 row I would have spent close to 200k and won 2.5 mil.
Only problem is that I don't have the 10 to start with, the 200k is a maybe .
I need to be able to generate the combinations to play the numbers.
View 9 Replies
View Related
Apr 16, 2014
removing duplicate rows and move other data frm rows to columns.xlsx.
I am attaching a sample excel sheet showing what I need to do.In the first tab, I have a list that includes duplicate rows (first column only). I want to remove those duplicate rows but I don't want to lose the data in the following columns which can be unique or duplicates as well.
see the desired result tab in the sheet to get an idea of what I am looking for as the end result.
Keep in mind that the actual source file I am working with could have up to 50000 row, and the expected results could be around 2000 rows. So nothing can be done manually.
View 5 Replies
View Related