Finding Duplicate Rows & Highlighting them
frankjh19701 wrote:
I have data in a worksheet that contains both numbers & text.
I want to find a formula or Macro that can search the entire sheet and
ONLY highlight the rows that are duplicated. Not just the first cell,
the whole row.
The data goes from Column A to Column M.
I don't want them deleted or moved - only highlighted.
This will bold the duplicated rows. Other methods of "highlighting" are
possible, just depends on what you want.
Sub findDupsAndBold()
For L0 = 1 To Cells.SpecialCells(xlCellTypeLastCell).Row - 1
For L1 = L0 + 1 To Cells.SpecialCells(xlCellTypeLastCell).Row
theSame = True
For L2 = 1 To Cells.SpecialCells(xlCellTypeLastCell).Column
If Cells(L0, L2).Value < Cells(L1, L2).Value Then
theSame = False
Exit For
End If
Next
If theSame Then
Rows(L0).Font.Bold = True
Rows(L1).Font.Bold = True
End If
Next
Next
End Sub
(There are probably better ways to do this, but I already had a similar thing
written.)
--
- I'm not the type to be led around by woman.
- Then lead her around.
- I'm even less the type to do that.
|