Sub xx() m = ActiveSheet.UsedRange.Item(ActiveSheet.UsedRange.Count).Row n = ActiveSheet.UsedRange.Item(ActiveSheet.UsedRange.Count).Column For i = 12 To n If Cells(1, i) <> "" Then For j = 2 To 11 If Cells(1, j) = Cells(1, i) Then Exit For Next For k = 2 To m If Cells(k, i) <> "" And Cells(k, i) = Cells(k, j) Then Cells(k, i).Interior.ColorIndex = 3 Next End If NextEnd Sub