View Single Post
  #3   Report Post  
[email protected] hendrmi@hotmail.com is offline
Junior Member
 
Posts: 1
Default

Quote:
Originally Posted by Gary''s Student View Post
Try this small macro:

Sub altan()
n = Cells(Rows.Count, "A").End(xlUp).Row
v1 = 1
v2 = 56
Set r = Range("A:A")
For i = 1 To n
Set r2 = Cells(i, 1)
m = Application.WorksheetFunction.CountIf(r, r2)
If m 1 Then
p = Int(((v2 - v1 + 1) * Rnd) + v1)
Cells(i, 1).EntireRow.Interior.ColorIndex = p
End If
Next
End Sub
--
Gary''s Student - gsnu200787
[/i][/color]
********************************************
Hey Gary"s...

I love the script but have one question/request.
When I ran it-it highlighted each duplicate a different color.
Is there any way to have it randomly color each SET of duplicates?
thanks, -h