Solution to Find and move the duplicate values in another sheet
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 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago