Hi all,
I need a macros that can match vehicle registration plates with each other, where not all characters are necessarily the same. The macro's I currently use is:
Sub abc()
Const sh1 As String = "sheet1" '<-- Change for your needs
Const sh2 As String = "sheet2" '<-- Change for your needs
Dim a, i As Long
With Worksheets(sh1)
a = .Range("a1").CurrentRegion
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(a)
If Not .exists(a(i, 2)) Then
.Item(a(i, 2)) = Join(Array(a(i, 1), a(i, 2), a(i, 3)), "|")
Else
.Item(a(i, 2)) = Join(Array(.Item(a(i, 2)), a(i, 1), a(i, 2), a(i, 3)), "|")
End If
Next
a = .items
End With
With Worksheets(sh2)
.Cells.Clear
For i = 0 To UBound(a)
x = Split(a(i), "|")
.Cells(i + 1, 1).Resize(, UBound(x) + 1) = x
Next
End With
End Sub
Can this be adapted to assume an O and 0 are the same for example.
Bookmarks