Please help.
I'm new to dictionary.
Something wrong.
trying to check if the string already in the dictionary.
Dim dic As Object
Set dic = CreateObject("system.collections.arraylist")
Set twb = ThisWorkbook
Set tws = twb.Sheets("Array1")
Set FX = twb.Sheets("Array2")
Dim Key
Dim item
For i = 1 To Application.WorksheetFunction.CountA(tws.Columns(1))
Key = tws.Cells(i, 1) & tws.Cells(i, 2) & tws.Cells(i, 5) & tws.Cells(i, 6) & tws.Cells(i, 13)
dic.Add Key
Next
For Z = 1 To Application.WorksheetFunction.CountA(FX.Columns(1))
item = FX.Cells(Z, 1) & FX.Cells(Z, 2) & FX.Cells(Z, 4) & FX.Cells(Z, 5) & FX.Cells(Z, 6)
If dic.Exists(item) Then
FX.Cells(Z, 1).Style = "Bad"
FX.Cells(Z, 2).Style = "Bad"
FX.Cells(Z, 4).Style = "Bad"
FX.Cells(Z, 5).Style = "Bad"
FX.Cells(Z, 6).Style = "Bad"
FX.Cells(Z, 7).Value = "Duplicate"
FX.Cells(Z, 7).Style = "Bad"
End If
Next
Set dic = Nothing
Big Thanks,
Bookmarks