Excel VBA and Color Format

Have typical VBA to find duplicates and set the duplicate cell's background in different colors. (see below)  Instead of specific cell changing color I would like multiple cells (cells from columns A to H) to be colored.  How to code?
Thanks

        Dim cel As Range
        Dim myrng As Range
        Dim clr As Long

        Set myrng = Range("H2:H" & Range("H65536").End(xlUp).Row)
        myrng.Interior.ColorIndex = xlNone
        clr = 3

        For Each cel In myrng
           If Application.WorksheetFunction.CountIf(myrng, cel) > 1 Then
              If WorksheetFunction.CountIf(Range("H2:H" & cel.Row), cel) = 1 Then
                 cel.Interior.ColorIndex = clr
                 clr = clr + 1
                    If clr = 56 Then clr = 3
              Else
                 cel.Interior.ColorIndex = myrng.Cells(WorksheetFunction.Match(cel, myrng, False), 1).Interior.ColorIndex
              End If
          End If
       Next
ka_incAsked:
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.

Rory ArchibaldCommented:
Change both references to this:
cel.Interior.ColorIndex

Open in new window

to be:
Cells(cel.row, "A").Resize(, 8).Interior.ColorIndex

Open in new window

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
ka_incAuthor Commented:
Thank you
0
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
Visual Basic Classic

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.