MAKE CONDITIONAL FORMATTING TO REPEAT VALUE FOR 4 LETTERS

4 letters  in any position any time!

Have an table with some txt value inn the form  ABCD, EFGH,
ABCD, DEFG. GHIJ,  

need make an conditional formating to the same letters

could be AABC,  ABCC, ABCB, ABCA, DADB
the repeeat letter could be any position any time!

any assistance apreciate !
micky runningAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
to do this, you just need to extend the conditions in the IIF() statement..

copy and paste this, change [FieldName] with the actual name of control

Expression Is  IIf(mid([FieldName],1,1)=mid([FieldName],2,1),-1,IIf(mid([FieldName],1,1)=mid([FieldName],3,1),-1,IIf(mid([FieldName],1,1)=mid([FieldName],4,1),-1,IIf(mid([FieldName],2,1)=mid([FieldName],3,1),-1,IIf(mid([FieldName],2,1)=mid([FieldName],4,1),-1,IIf(mid([FieldName],3,1)=mid([FieldName],4,1),-1,0))))))=-1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
micky runningAuthor Commented:
Rey you lead the way !
thanks very much!!
0
micky runningAuthor Commented:
REY Working Great !
0
Dale FyeCommented:
A function would be far more efficient and a whole lot easier to read:

Public Function fnHasMatch(SomeValue as Variant = NULL) as boolean

    Dim intLoop1 as integer, intLoop2 as integer

    'Determines whether one of the characters in a string is repeated
    fnHasMatch = false
    if isNull(SomeValue) Then Exit Function

    for intLoop1 = 1 to LEN(SomeValue)
        for intLoop2 = 1 to LEN(SomeValue)
            if intLoop1 <> intLoop2 THEN
                if Mid(SomeValue, intLoop1, 1) = Mid(SomeValue, intLoop2, 1) Then
                    fnHasMatch = True
                    Exit Function
                end if
            end if
        next
    next

End Function.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.