+ Reply to Thread
Results 1 to 3 of 3

Deleting Duplicates

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    26

    Deleting Duplicates

    (New Member and first reply to a thread)

    Do you know of a way of Deleting duplicate records, using Excel 2003.

    The raw data is in the form of a text string. For example:

    Vehicle 123456_F_AB 280
    Vehicle 123456_R_AB 147

    So when I do a count of these cells, I obtain a count of 2. '=Count(A1)'. How can I easily exclude 1 of the duplicates (123456). It needs to be a user friendly solution as other people may have to run this when I'm on leave? Thanks in advance if you know the answer.


    Regards
    David R.

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Deleting Duplicates-find out a way to delete duplicates

    Quote Originally Posted by david2020 View Post
    (New Member and first reply to a thread)

    Do you know of a way of Deleting duplicate records, using Excel 2003.

    The raw data is in the form of a text string. For example:

    Vehicle 123456_F_AB 280
    Vehicle 123456_R_AB 147

    So when I do a count of these cells, I obtain a count of 2. '=Count(A1)'. How can I easily exclude 1 of the duplicates (123456). It needs to be a user friendly solution as other people may have to run this when I'm on leave? Thanks in advance if you know the answer.


    Regards
    David R.
    David, try this:
    Please Login or Register  to view this content.
    Click on the star if you think I helped you

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    26

    Re: Deleting Duplicates-find out a way to delete duplicates

    I tried the coding you supplied but, I was unable to make it work. This was due to lack of knowledge on my use of VB. I tried pasting this into a module and exporting it. Then going to Tools > Macro > Macros but unable to make it work. I wonder if the problem description I originally supplied was too vague.

    However, a work collegue copied and pasted this one into a module for me and this seemed to work.

    Sub DeleteDuplicates()
    Dim i As Integer
    Dim j as Integer

    i = 3
    j = 1

    Do
    If Cells(i, j) = Cells(i - 1, j) Then
    Rows(i).Select
    Selection.Delete
    i = i - 1
    End If
    i = i + 1
    Loop Until Cells(i, j) = ""

    End Sub


    It's been an enjoyable learning curve doing this. Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Deleting Duplicates!!
    By melkon99 in forum Excel General
    Replies: 11
    Last Post: 10-01-2012, 08:06 PM
  2. Deleting Duplicates-find out a way to delete duplicates
    By sighlent1 in forum Excel General
    Replies: 2
    Last Post: 04-19-2011, 10:17 AM
  3. Deleting Duplicates
    By 3smees23 in forum Excel General
    Replies: 3
    Last Post: 05-07-2009, 10:48 AM
  4. Deleting duplicates
    By katana in forum Excel General
    Replies: 4
    Last Post: 02-07-2006, 02:35 PM
  5. [SOLVED] Deleting duplicates
    By Judd Jones in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 12:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1