LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Checking entire row for duplicates

Sub Dups()
Dim bDup as Boolean
Do
bDup = True
for each cell in Activecell.EntireRow.Cells
If cell.Value < Cell.Offset(1, 0).Value Then
bDup = False
exit for
End If
next
if bDup then
ActiveCell.Offset(1,0).EntireRow.Delete
else
ActiveCell.Offset(1,0).Select
End if
Loop Until isempty(ActiveCell.Value)
End Sub

--
Regards,
Tom Ogilvy



"SHiggins" wrote in message
...
I am trying to remove duplicates in my data where the entire row matches

the one under it. So far I have it where it checks just one cell to see if
it matches. How do I have it look at the entire row?

Thanks!

Here is my code so far:

Sub Dups()
Do
If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
'ActiveCell.EntireRow.Delete
ActiveCell.Offset(1, 0).EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Activate
End If
Loop Until ActiveCell.Value = Empty
End Sub



 
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
Checking for Duplicates within a Workbook RAYCV Excel Worksheet Functions 7 September 23rd 08 12:10 PM
checking for duplicates Ted Metro Excel Worksheet Functions 1 April 3rd 07 05:42 PM
Error Checking for Duplicates in List bman342 Excel Worksheet Functions 2 June 29th 06 11:15 AM
Checking for duplicates - think this is simple [email protected] Excel Discussion (Misc queries) 9 February 27th 06 09:32 PM
Checking for duplicates? Eric G[_3_] Excel Programming 4 April 8th 04 02:54 AM


All times are GMT +1. The time now is 12:26 AM.

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

About Us

"It's about Microsoft Excel"