Excel/Finding duplicate value
Hope u are fine..
I have a data with number and text in column like below,
i want to find out the duplicate value within that column,
which i can find from conditional formatting tool by highlighting duplicate values option.
but it shows all the duplicate value in one color, such as after click of highlight duplicate it's shows all in pink.
in above case my duplicate values are 14,75,rak,gho and system showing all in pink color.
i want them in different color (e.g 14/14 should have green, 75/75 in red, rak/rak in yellow etc...
hope you understand what i mean to say.
i want duplicate values should be in different set of color , so that i can identify that how many set of duplicate values.
present in data.
select your data and run this routine. i can only take values 1 to 56. I started it at 33 since those colors are lighter. However, if you have a lot of differenct duplicate values, it will loop around and may color a cell with a dark color.
Dim r As Range, cell As Range
Dim r1 As Range, cell1 As Range
Dim i As Long
i = 33
Set r = Selection
r.Interior.ColorIndex = xlNone
For Each cell In Selection
If cell.Row < r(r.Count).Row Then
Set r1 = Range(cell.Offset(1, 0), r(r.Count))
If Application.CountIf(r1, cell) > 0 Then
For Each cell1 In r1
If cell.Value = cell1.Value Then
cell.Interior.ColorIndex = i
cell1.Interior.ColorIndex = i
i = i + 1
if i > 56 then i = 3
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here