Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello,
I need to highlight batch of duplicates in different color. For example one set of dups will be red and next set would be yellow and so on. I have this macro but it highlights every dups with diffrent color. Sub FindDups() ' ' NOTE: You must select the first cell in the column and ' make sure that the column is sorted before running this macro ' ScreenUpdating = False FirstItem = ActiveCell.Value SecondItem = ActiveCell.Offset(1, 0).Value Offsetcount = 1 Do While ActiveCell < "" If FirstItem = SecondItem Then ActiveCell.Offset(Offsetcount, 0).Interior.ColorIndex = Int(Rnd(1) * 21) + 2 Offsetcount = Offsetcount + 1 SecondItem = ActiveCell.Offset(Offsetcount, 0).Value Else ActiveCell.Offset(Offsetcount, 0).Select FirstItem = ActiveCell.Value SecondItem = ActiveCell.Offset(1, 0).Value Offsetcount = 1 End If Loop ScreenUpdating = True End Sub Any help? Thx. -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Highlight Duplicates, Macro? | Excel Worksheet Functions | |||
Color duplicates | Excel Discussion (Misc queries) | |||
how do I highlight duplicates cells in excell prior to deletion | Excel Worksheet Functions | |||
How do i locate/highlight duplicates ? | Excel Discussion (Misc queries) | |||
compare two columns within a worksheet, then highlight duplicates | Excel Worksheet Functions |