First off, a huge thank you for any assistance that can be provided.
I searched the forums and found the code below to highlight values which match (seems to be single values in each column). How could this be modified to compare delimited values to highlight the matching values between the 2 columns. Data will always be a single value or multiple values delimited with a semi-colon ";". I am looking to determine if there are 'conflicting' values, so the code only needs to analyze cells in column C which contain a semi-colon (if there is only one value, there cannot be a conflict).
I would like the matching values to be highlighted in Red (instead of Green). I have included a screen shot of my data. Basically, column E contains the conflicting values, and for column C, if there are matching values to 2 or more of the values in column E, color code the values in Red font color.
Data: The number of rows in Column C and Column E can be different every time I need to do the comparison, so need the code to determine the last row for both columns to compare all the rows.
Sub Nanditha()
Dim Cl As Range
Dim Dic As Object
Set Dic = CreateObject("scripting.dictionary")
Dic.CompareMode = 1
With Sheets("dnd")
For Each Cl In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
Dic(Cl.Value) = Empty
Next Cl
End With
With Sheets("cc5")
For Each Cl In .Range("P2", .Range("P" & Rows.Count).End(xlUp))
If Dic.Exists(Cl.Value) Then Cl.Font.Color = rgbLimeGreen
Next Cl
End With
End Sub
I searched the forums and found the code below to highlight values which match (seems to be single values in each column). How could this be modified to compare delimited values to highlight the matching values between the 2 columns. Data will always be a single value or multiple values delimited with a semi-colon ";". I am looking to determine if there are 'conflicting' values, so the code only needs to analyze cells in column C which contain a semi-colon (if there is only one value, there cannot be a conflict).
I would like the matching values to be highlighted in Red (instead of Green). I have included a screen shot of my data. Basically, column E contains the conflicting values, and for column C, if there are matching values to 2 or more of the values in column E, color code the values in Red font color.
Data: The number of rows in Column C and Column E can be different every time I need to do the comparison, so need the code to determine the last row for both columns to compare all the rows.
Sub Nanditha()
Dim Cl As Range
Dim Dic As Object
Set Dic = CreateObject("scripting.dictionary")
Dic.CompareMode = 1
With Sheets("dnd")
For Each Cl In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
Dic(Cl.Value) = Empty
Next Cl
End With
With Sheets("cc5")
For Each Cl In .Range("P2", .Range("P" & Rows.Count).End(xlUp))
If Dic.Exists(Cl.Value) Then Cl.Font.Color = rgbLimeGreen
Next Cl
End With
End Sub