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: 72
Default Identify duplicates and move to new sheet

I have a very long worksheet that occasionally contains duplicate numbers in
Col A or duplicate numbers in col B. I'd like to copy these duplicates from
the sheet titled "AllRecords" and move them to a sheet in the existing
workbook titled, "Duplicate Records" with VBA. I've tried altering this code
and have not had any success, I can't figure out how to stipulate duplicates
in those columns. Any help you can provide is greatly appreciated. Thank you

Dim rng As Range, cell As Range

Dim i As Long, sh As Worksheet
With Worksheets("All Records")
Set rng = .Range(.Cells(1, 1), _
.Cells(Rows.Count, 1).End(xlUp))
End With
i = 1

Set sh = Worksheets("DUPLICATE RECORDS")
For Each cell In rng
cell.EntireRow.Copy sh.Cells(i, 1)
i = i + 1

End If
 
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
Identify Duplicates that are not identical KFM Excel Discussion (Misc queries) 4 October 13th 09 06:17 PM
Identify Duplicates in a List BStacy Excel Discussion (Misc queries) 1 April 16th 09 07:20 PM
How to identify text (compare) in one sheet, then move it another mag7417[_3_] Excel Programming 4 December 14th 05 02:54 PM
How to identify text (compare) in one sheet, then move it another mag7417[_4_] Excel Programming 0 December 14th 05 10:38 AM
identify duplicates 5thsun7thchild Excel Discussion (Misc queries) 1 September 1st 05 04:06 PM


All times are GMT +1. The time now is 03:26 PM.

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"