ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add in for removing duplicate rows? (https://www.excelbanter.com/excel-programming/345540-add-removing-duplicate-rows.html)

[email protected]

Add in for removing duplicate rows?
 
Is there an add in available (free - stretching it I know!) for
removing duplicate rows except for the first occurance.

Thanks
Tony


Tom Ogilvy

Add in for removing duplicate rows?
 
There may be one, but you really can handle it on your own. See Chip
Pearson's page on this for ideas:

http://www.cpearson.com/excel/duplicat.htm

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Is there an add in available (free - stretching it I know!) for
removing duplicate rows except for the first occurance.

Thanks
Tony




Bob Phillips[_6_]

Add in for removing duplicate rows?
 
Not that I know of, but if you give us the duplication criteria, I am sure
that we could knock something up pretty quickly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Is there an add in available (free - stretching it I know!) for
removing duplicate rows except for the first occurance.

Thanks
Tony




grahammal[_9_]

Add in for removing duplicate rows?
 

Wrote:
Is there an add in available (free - stretching it I know!) for
removing duplicate rows except for the first occurance.

Thanks
Tony


10 For uY = 1 To 6 'Spin thru 6 times to get them all
20 Qq = Application.CountA(ActiveSheet.Range("A:A")) 'Get row coun
before beginning
30 For oZ = 2 To Qq 'Main loop
40 If Cells(oZ, 1) = Cells(oZ - 1, 1) Then 'Check for dups
50 Cells(oZ, 1).Select 'Select the cell
60 Selection.Delete Shift:=xlUp 'Delete
70 Qq = Qq - 1 'Change loop criteria because cell gone
80 End If 'End
90 Next oZ 'Inside loop
100 Next uY 'Outside loop

Have only added line numbers to explain

This will take any amount of rows but only checks column "A"
Line numbers 50 & 60 select and delete the duplicated data in colum
"A" only.
If you want it to delete data across the columns then you will need t
add more lines.

Example
' This deletes data in column "B"
Cells(oZ, 2).Select 'Select the cell
Selection.Delete Shift:=xlUp 'Delete
' This deletes data in column "C"
Cells(oZ, 3).Select 'Select the cell
60 Selection.Delete Shift:=xlUp 'Delete
' This deletes data in column "D"
Cells(oZ, 4).Select 'Select the cell
60 Selection.Delete Shift:=xlUp 'Delete
etc

Hope this help

--
grahamma
-----------------------------------------------------------------------
grahammal's Profile:
http://www.excelforum.com/member.php...fo&userid=2033
View this thread: http://www.excelforum.com/showthread.php?threadid=48483



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com