Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,180
- Office Version
- 365
- 2019
- Platform
- Windows
https://www.mrexcel.com/forum/excel-questions/1054389-compare-two-column.html
Based off of the thread above, how do I get the code to highlight both columns if they do not match.
mumps code:
Based off of the thread above, how do I get the code to highlight both columns if they do not match.
mumps code:
Code:
Sub CompareLists()
Application.ScreenUpdating = False
Dim Rng As Range, RngList As Object
Set RngList = CreateObject("Scripting.Dictionary")
For Each Rng In Range("B1", Range("B" & Rows.Count).End(xlUp))
If Not RngList.Exists(Rng.Value) Then
RngList.Add Rng.Value, Nothing
End If
Next Rng
For Each Rng In Range("A1", Range("A" & Rows.Count).End(xlUp))
If Not RngList.Exists(Rng.Value) Then
Rng.Font.ColorIndex = 3
End If
Next Rng
RngList.RemoveAll
Application.ScreenUpdating = True
End Sub