Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default 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
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
how to identify duplicate rows & staffs xfr frm one depart to anot Calculate Date range Excel Discussion (Misc queries) 1 August 25th 09 10:41 AM
Delete Duplicate rows in an Excel list Jmh3115 Excel Discussion (Misc queries) 2 March 7th 09 06:05 AM
Identify duplicate rows Joe Excel Discussion (Misc queries) 1 October 17th 07 12:25 AM
Identify the duplicate and delete with details in excel mat Excel Discussion (Misc queries) 0 November 15th 06 09:03 PM
Identify and move duplicate rows? ali Excel Programming 11 January 28th 04 06:19 AM


All times are GMT +1. The time now is 02:42 AM.

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

About Us

"It's about Microsoft Excel"