Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: eliminate duplicates

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi I have some sequence numbers in coulumn A and i want to eliminate duplicate rows from the sheet. How can i do it any suggestions???
    Thanks

  2. #2
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-10 09:43, guest wrote:
    Hi I have some sequence numbers in coulumn A and i want to eliminate duplicate rows from the sheet. How can i do it any suggestions???
    Thanks
    You can do this by using DATA|FILTER|Advanced_Filter

    have the un1que entries copied to another column say, column C, then proceed from there.

    Regards!





    Regards!

    Yogi Anand, D.Eng, P.E.
    Energy Efficient Building Network LLC
    www.energyefficientbuild.com

  3. #3
    New Member
    Join Date
    Feb 2002
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    try this code:

    Sub Edit_EmptyDuplicateCells()
    On Error GoTo EndMacro
    If selection.Columns.Count > 1 Then
    MsgBox "Sorry, you may only select cells in one column.", vbExclamation
    Exit Sub
    Else
    End If
    If selection.Rows.Count > 1 Then
    Set rng = selection
    Else
    MsgBox "Please select cells in multiple rows.", vbExclamation
    Exit Sub
    End If
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    i = selection.Cells.Count
    n = 0
    For r = rng.Rows.Count To 1 Step -1
    v = rng.Cells(r, 1).Value
    If Application.WorksheetFunction.CountIf(rng.Columns(1), v) > 1 Then
    rng.Rows(r).ClearContents
    n = n + 1
    End If
    Percentage = n / i * 100
    Application.StatusBar = "Now processing: " & Percentage & "%"
    Next r
    EndMacro:
    MsgBox Format(n) & " cells have been cleared.", vbInformation
    End Sub

  4. #4
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    This code will delete dupes until a blank row is found.

    Code:
    Sub DeleteDups()
      Do
      RowCnt = RowCnt + 1
      RowCnt2 = RowCnt + 1
       Do
            If Cells(RowCnt, 1).Value = Cells(RowCnt2, 1).Value Then Rows(RowCnt2 & ":" & RowCnt2).Delete Shift:=xlUp
          RowCnt2 = RowCnt2 + 1
        Loop Until Len(Trim(Cells(RowCnt2, 1).Value)) = 0
      Loop Until Len(Trim(Cells(RowCnt, 1).Value)) = 0
    End Sub
    [ This Message was edited by: Nimrod on 2002-05-10 11:05 ]

    [ This Message was edited by: nimrod on 2002-05-10 11:17 ]

    [ This Message was edited by: Nimrod on 2002-05-10 11:19 ]

    [ This Message was edited by: Nimrod on 2002-05-10 11:23 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •