Hi,
I have this script to compare:
'Option Explicit
'Sub FindDuplicate()
'Dim LastRow As Long
'Dim MyRg1 As Range, MyRg2 As Range
'Dim A As Range
'Dim F
' Application.ScreenUpdating = False
'LastRow = Range("a" & Rows.Count).End(xlUp).Row
'Range("B1:B" & LastRow).ClearContents
'Set MyRg1 = Range(Cells(2, "A"), Cells(Rows.Count, "A").End(xlUp))
'With Sheets("Sheet2")
'Set MyRg2 = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
'End With
'With MyRg2
'For Each A In MyRg1
'If (A <> Empty) Then
'Set F = .Find(What:=A.Value, After:=.Cells(1, 1), LookIn:=xlValues, _
'LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
'MatchCase:=False)
'If (Not F Is Nothing) Then
'A.Offset(0, 1) = .Cells(F.Row, F.Column + 1)
'End If
'End If
'Next A
' End With
'Application.ScreenUpdating = True
'End Sub
What I cant it to do is to colorize (if its works) when it find dublicates or that the script write all dublicates in worksheet 3. I also want it so search in the whole range in sheet 1 and sheet 2. Someone that can helps me?
Thank you!
I have this script to compare:
'Option Explicit
'Sub FindDuplicate()
'Dim LastRow As Long
'Dim MyRg1 As Range, MyRg2 As Range
'Dim A As Range
'Dim F
' Application.ScreenUpdating = False
'LastRow = Range("a" & Rows.Count).End(xlUp).Row
'Range("B1:B" & LastRow).ClearContents
'Set MyRg1 = Range(Cells(2, "A"), Cells(Rows.Count, "A").End(xlUp))
'With Sheets("Sheet2")
'Set MyRg2 = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
'End With
'With MyRg2
'For Each A In MyRg1
'If (A <> Empty) Then
'Set F = .Find(What:=A.Value, After:=.Cells(1, 1), LookIn:=xlValues, _
'LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
'MatchCase:=False)
'If (Not F Is Nothing) Then
'A.Offset(0, 1) = .Cells(F.Row, F.Column + 1)
'End If
'End If
'Next A
' End With
'Application.ScreenUpdating = True
'End Sub
What I cant it to do is to colorize (if its works) when it find dublicates or that the script write all dublicates in worksheet 3. I also want it so search in the whole range in sheet 1 and sheet 2. Someone that can helps me?
Thank you!