Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50079

Macro to read cell content in any order

$
0
0
Hi to all,

Existing macro is

Code:

Sub highlightActive1()
    Dim cs, ca As Range
    Dim i As Integer
    ' reset colour
    Call cleansBorCol
    For i = 1 To 2
            For Each cs In Selection
            For Each ca In Sheets(i).UsedRange
                If ca.Value = cs.Value Then
                    ca.Cells.Interior.ColorIndex = 4
                End If
            Next ca
        Next cs
    Next i
End Sub

Reads cell content in exact order ex. "ABC" is active and all cells "ABC" would be "green"
I'd like to modify it in order to color all variants of "ABC" (BAC ACB BCA etc would be "green")

Thank you in advance

Viewing all articles
Browse latest Browse all 50079

Trending Articles