解决方案 »

  1.   

    请参考:
    Sub Test()
        ''执行前引用字典:Microsoft Scripting Runtime
        Dim Rng As Range, iDic As New Dictionary
        Dim w1 As String
        For Each Rng In Range("a1:d3")
            ''Debug.Print Rng.Address(0, 0)''从左到右,从上到下
            w1 = Rng.Value
            If iDic.Exists(LCase$(w1)) Then
                Rng.Interior.Color = vbRed
                Rng.Font.Color = vbYellow
            Else
                iDic(LCase$(w1)) = "0"
                Rng.Interior.ColorIndex = xlNone
                Rng.Font.ColorIndex = 0
            End If
        Next
        iDic.RemoveAll
    End Sub