Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Identify and delete duplicate rows
I have a MS Excel 2003 sheet with with rows of information about staff, first
name, surname and staff, staff no. The spreadsheet is very big how can I identify any duplicate row enties and delete the duplicate for the whole speadsheet by using a macro or other method. A duplicate row will be where the first name, surname and staff no. match another in the spreadsheet and where one entry needs to be deleted. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Identify and delete duplicate rows
Chip as lots about duplicates at www.cpearson.com
best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Tariq" wrote in message ... I have a MS Excel 2003 sheet with with rows of information about staff, first name, surname and staff, staff no. The spreadsheet is very big how can I identify any duplicate row enties and delete the duplicate for the whole speadsheet by using a macro or other method. A duplicate row will be where the first name, surname and staff no. match another in the spreadsheet and where one entry needs to be deleted. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Identify and delete duplicate rows
Adjust the cell references to suit your needs.
With Cells Set rng = .Range(.Cells(1, 8), .Cells(1, 8).End(xlDown)) rng.Select End With Dim RowNdx As Long Dim ColNum As Integer ColNum = Selection(1).Column For RowNdx = Selection(Selection.Cells.Count).Row To _ Selection(1).Row + 1 Step -1 If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Value And _ Cells(RowNdx, ColNum - 2) = Cells(RowNdx - 1, ColNum - 2).Value Then Cells(RowNdx - 1, ColNum - 1) = Cells(RowNdx - 1, ColNum - 1) + Cells(RowNdx, ColNum - 1) Cells.EntireRow(RowNdx).Delete shift:=xlUp End If Next RowNdx -- Best wishes, Jim "Tariq" wrote: I have a MS Excel 2003 sheet with with rows of information about staff, first name, surname and staff, staff no. The spreadsheet is very big how can I identify any duplicate row enties and delete the duplicate for the whole speadsheet by using a macro or other method. A duplicate row will be where the first name, surname and staff no. match another in the spreadsheet and where one entry needs to be deleted. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to identify duplicate rows & staffs xfr frm one depart to anot | Excel Discussion (Misc queries) | |||
Delete Duplicate rows in an Excel list | Excel Discussion (Misc queries) | |||
Identify duplicate rows | Excel Discussion (Misc queries) | |||
Identify the duplicate and delete with details in excel | Excel Discussion (Misc queries) | |||
Identify and move duplicate rows? | Excel Programming |