View Full Version : Need Help! Excel Macro Code

28-10-2001, 05:57 PM
Is there a program code that will identify/highlight? duplicate entries on multi page spreadsheet?
I have tried:
Public Sub()
Dim N As Integer
Dim M As Integer
Dim FirstCellToSort As Integer
Dim LastCellsToSort As Integer
Dim SortDescending As Boolean

SortDescending = False
FirstCellToSort = 1
LastCellsToSort = Cells.Count

For M = FirstCellToSort To Last CellsToSort
For N = M To LastCellsToSort

If SortDescending = True Then

If UCase(Cells(N).Name) >= UCase(Cells(M).Name)Then
Cells(N).Move Before: =Cells(M)
End If
ElseIf UCase(Cells(N).Name) <= UCase(Cells(M).Name) Then Cells(N).Move Before: =Cells(M)
End If
Next N
Next M
End Sub

29-10-2001, 09:54 AM
Just for clarification,
Are the duplicate entries based on the same column or across a number of columns?
Are the entries always text?
Are you wanting to remove existing duplicates or to prevent the addition of new entries which already exist?

30-10-2001, 02:34 PM
Numeric column. The numeric column is the one that I want to filter out any duplicates.
Thanks for any help you have on resolving this code issue.