I have 2 worksheets one is data and other is duplicated numbers I need a macro to search duplicated numbers in Data Sheet and copy these numbers in Duplicated Numbers Sheet
Thanks in advance
I have 2 worksheets one is data and other is duplicated numbers I need a macro to search duplicated numbers in Data Sheet and copy these numbers in Duplicated Numbers Sheet
Thanks in advance
Re: Copy Duplicated Numbers Between 2 Sheets
Are the duplicated numbers in a single column, row or over the whole sheet?, what is the range?, do you want the duplicate numbers deleted sfter copying?
Re: Copy Duplicated Numbers Between 2 Sheets
Thanks for your reply
Numbers are in column C
Re: Copy Duplicated Numbers Between 2 Sheets
Thanks this is a good idea, yes duplicated numbers delete after copy.
Re: Copy Duplicated Numbers Between 2 Sheets
This looks for a count of more than one instance of an entry in column c sheet 1 then if there is copy the entire row to sheet 2 then delete the entry and so on!, just change the sheet names to suit.
Sub Macro1()
Dim Rng1 As Range, MyCell As Range
Sheets("Sheet1").Select
Set Rng1 = Sheets("Sheet1").Range("C2:C" & Range("C65536").End(xlUp).Row)
For Each MyCell In Rng1
If Application.WorksheetFunction.CountIf(Rng1, MyCell.Value) > 1 Then
MyCell.EntireRow.Copy Destination:=Sheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0)
MyCell.EntireRow.Delete Shift:=xlUp
End If
Next MyCell
End Sub
Display More
[hr]*[/hr] Auto Merged Post Until 24 Hrs Passes;[dl]*[/dl]Cross posted!
http://vbaexpress.com/forum/showthread.php?t=18688
Re: Copy Duplicated Numbers Between 2 Sheets
Thanks
Re: Copy Duplicated Numbers Between 2 Sheets
decent_boy,
MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question
*
Don't bother PM'ing me your feeble excuses either.
Don’t have an account yet? Register yourself now and be a part of our community!