Search and then format by color

S

swimeveryday

I have a column of data that is almost 5000 cells deep. I want to be able to
have the groups of duplicates colored a unique color. For example, if there
are 12 cells that have a value of 9231, I want to see that those 12 and only
those 12 get colored red. Then, maybe there are 200 cells that have a value
of 74; those would all get blue. And so on, such that each group of equal
valued cells gets a unqiue color. Can this be done and if so, how? Thanks!
It would really help if you could post AND email me an answer at
(e-mail address removed).
 
J

JB

Sub GroupColor()
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range("a2", [a65000].End(xlUp))
mondico.Item(c.Value) = mondico.Item(c.Value) + 1
Next c
For Each c In Range("a2", [a65000].End(xlUp))
If mondico.Item(c.Value) > 1 Then
p = Application.Match(c.Value, mondico.keys, 0)
c.Interior.ColorIndex = p + 2
End If
Next c
End Sub

http://cjoint.com/?eng7tTxg62


JB
http://boisgontierjacques.free.fr/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top