Solution to Find and move the duplicate values in another sheet
![Vikas Verma's picture Vikas Verma's picture](http://excelexperts.com/sites/default/files/pictures/picture-8712.jpg)
Find and move the duplicate values in another sheet....
Before using the below mentioned code please use conditional formatting with =COUNTIF($A$1:A1,A1)>1 formula there after this code will work.
Hope it will help you...
Sub test()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim rng As Range
Dim cell As Range
Set rng = Application.InputBox("Select a range", Type:=8)
j = 1
For Each cell In rng
If cell.DisplayFormat.Interior.Color <> 16777215 Then
rcount = Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row
cell.Cut Destination:=Sheets(2).Range("A" & j)
j = j + 1
End If
Next
rng.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Thanks & regards,
Vikas Verma
Attachment | Size |
---|---|
Find and move the duplicate values in another sheet.xlsm | 18.27 KB |
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 47 weeks ago
6 years 50 weeks ago
6 years 51 weeks ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago