Consulting

Results 1 to 7 of 7

Thread: Solved: Help Removing Duplicates

  1. #1
    VBAX Regular markmrw's Avatar
    Joined
    Oct 2008
    Location
    UK
    Posts
    35
    Location

    Solved: Help Removing Duplicates

    Good morrow

    i need some help with my code (attached)

    i have a module that removes duplicate values then does some other gumphf!

    But what i would like is for the macro not to just remove the duplicate values, but also the original values.

    For example

    123 ' i would like this deleted
    125
    124
    123 ' and this

    thank you this has caused me much brain already.

    Mark
    Attachment 10727

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Some of us don't have 2007 so we can't look at your file. Is this in the sheet or a combobox in a userform, etc.

    Can you post the code?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Regular markmrw's Avatar
    Joined
    Oct 2008
    Location
    UK
    Posts
    35
    Location
    i will do it better

    have a compatible version

    Mark

    Attachment 10728

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    So, are the duplicates on sheet Totals Pallet (8) and are they the box number?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Try this

    [VBA]Sub RemoveDuplicates()
    Dim rCell As Range

    For Each rCell In Range("A2:A70").Cells

    If WorksheetFunction.CountIf(Range("A:A"), rCell.Value) > 1 Then
    Range("A:A").Replace What:=rCell.Value, Replacement:=""
    End If

    Next rCell

    End Sub[/VBA]

    Hope this helps
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  6. #6
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Like this
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  7. #7
    VBAX Regular markmrw's Avatar
    Joined
    Oct 2008
    Location
    UK
    Posts
    35
    Location
    Thats fantastic
    thank you ver much i will post the final code when i get it up and running thank you very much

    Mark

Posting Permissions

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