My knowledge on VBA is limited, so I struggle even with this simple task. I want to check every cell in column B, if that cell value is duplicated in an another worksheet's column A. Then if it has duplicate values in that range, it colors the cell to yellow. Ive got this part working. The next thing I want to do is to color the cells in that same row in columns C, D and F. This part is not working for me, it gives me an Type Mismatch error. Any help on this would be appreciated.
Sub Mark_Duplicates()
Dim Cell As Variant
Dim Source As Range
Dim Source2 As Range
Dim rownumber As Variant
Set Source = Range("B1:B1000")
Set Source2 = Worksheets("Chain").Range("A1:A1000")
For Each Cell In Source
If Application.WorksheetFunction.CountIf(Source2, Cell) > 1 Then
rownumber = ActiveCell.Row
Cell.Interior.Color = RGB(255, 255, 0)
Range("C" & rownumber).Interior.Color = RGB(255, 255, 0)
Range("D" & rownumber).Interior.Color = RGB(255, 255, 0)
Range("F" & rownumber).Interior.Color = RGB(255, 255, 0)
End If
Next
End Sub