Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default scan for repeating values and then delete

I would like to loop through Column B, and if I find the same repeating
value, then I would like to delete the rows and keep only one. I would
always have 4 replicates, but would only like to keep one. For ex., Loop
through Column B, and if found "A2" multiple times, then delete 3 out of
the 4 rows. The values would vary. I do not want to sort Column B first
though.

I have the following so far, and don't know how to check to see if the
values are repeating.

For lRow = Range(Cells(1, 2), Cells(Cells.Rows.Count,
2).End(xlUp)).Rows.Count To 1 Step -1
......
Next

Thank you!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default scan for repeating values and then delete

You don't have to use loops. Just use the advance filter
and check unique records only. See below...
------------------------------------
Sub FilterUnique()

Range("B:B").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("C1"), Unique:=True

End Sub
------------------------------------
Hope this helps...

Chong Moua

-----Original Message-----
I would like to loop through Column B, and if I find the

same repeating
value, then I would like to delete the rows and keep only

one. I would
always have 4 replicates, but would only like to keep

one. For ex., Loop
through Column B, and if found "A2" multiple times, then

delete 3 out of
the 4 rows. The values would vary. I do not want to sort

Column B first
though.

I have the following so far, and don't know how to check

to see if the
values are repeating.

For lRow = Range(Cells(1, 2), Cells(Cells.Rows.Count,
2).End(xlUp)).Rows.Count To 1 Step -1
......
Next

Thank you!



*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.

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
Can I delete a portion of cell contents repeating in multiple fie. katkim Excel Discussion (Misc queries) 1 February 19th 10 04:25 PM
repeating values Peach Excel Worksheet Functions 1 November 29th 09 02:45 AM
repeating values [email protected] Excel Worksheet Functions 2 June 12th 08 04:55 PM
Delete Repeating text in cells Don B Excel Discussion (Misc queries) 2 September 3rd 06 10:24 PM
delete repeating rows aledger Excel Worksheet Functions 2 March 4th 05 08:43 PM


All times are GMT +1. The time now is 02:27 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"