Find and move the duplicate values in another sheet
Hello,
I have a file with many values, distributed across multiple columns.
From sheet1 i want to find and move all the duplicate values in the sheet 2
and I need a macro,a code macro to work at the level of the sheets, Sheet1-Sheet2
I want to move cut/paste all values duplicates 2 times 3 times or how many times is found
from sheet1, in sheet2 the results to be made in columns A and B
in sheet 1 to remain single value, only the values themselves which didn't pair
I mean if a value is 2 times
to move the original value
but and double found
Thank you
Attachment | Size |
---|---|
maxim.xlsx | 11.31 KB |
Try this also
Hi,
You can try this also...
Option Explicit
Sub test()
Dim rng As Range
Dim cell As Range
Dim i As Integer
i = 1
Dim sh As Worksheet
Set sh = Worksheets("sheet1")
Set rng = sh.Range("a1:h14")' Change this range as per your requirement
For Each cell In rng
If Application.WorksheetFunction.CountIf(rng, cell.Value) > 1 Then
Sheets(2).Cells(i, 1) = cell.Value
cell.Delete
i = i + 1
End If
Next
End Sub