I have a macro that compares the column of a table with the column of another (both are extracted from an application), and returns me which values do not exist in both. However, the Table4[MSG_DESCRIPTION] column has a limit of 50 characters, and the Table3[Title] column has 500 characters. I would need that in addition to returning the values that do not exist (as is already done) the macro would also be valid if the partial value of the Table4 column [MSG_DESCRIPTION] exists in the Table3 column [Title]. In formula I had used vlookup with & "*" and it worked, but I would need it in the macro.
Thanks.
Thanks.
VBA Code:
Sub ValoresUnicos()
Dim rngCell As Range
For Each rngCell In Range("Tabela4[MSG_DESCRIPTION]")
If WorksheetFunction.CountIf(Range("Tabela3[Title]"), rngCell) = 0 Then
Range("Comparação!C" & Rows.Count).End(xlUp).Offset(1) = rngCell
End If
Next
For Each rngCell In Range("Tabela3[Title]")
If WorksheetFunction.CountIf(Range("Tabela4[MSG_DESCRIPTION]"), rngCell) = 0 Then
Range("Comparação!H" & Rows.Count).End(xlUp).Offset(1) = rngCell
End If
Next
End Sub