+ Reply to Thread
Results 1 to 8 of 8

Union Ranges and remove duplicates

Hybrid View

  1. #1
    Registered User
    Join Date
    10-16-2007
    Posts
    16

    Union Ranges and remove duplicates

    Hello everyone. I'm very close on this one, I'm trying to get the final range to have all duplicates removed. For instance one of the rows with 'bob' and the number '4' shouldn't be seen in the final range. I'm including my sheet for ease of understanding. Thanks for any help.

    Private Sub cmdone_Click()
    Dim Rng1, Rng2 As Range
    Dim Final As Range
    Dim MyRange As Range
    Dim MyRange2 As Range
    Set wks3 = Worksheets(3)
    
    Worksheets(1).Activate
    Set Rng1 = Range("Range1")
    Rng1.Select
    Selection.Copy
    Worksheets(3).Activate
    [A1].Select
    Worksheets(3).Paste
    Worksheets(2).Activate
    Set Rng2 = Range("Range2")
    Rng2.Select
    Selection.Copy
    Worksheets(3).Activate
    [A20].Select
    Worksheets(3).Paste
    Range("A1:B65536", Range("A1:B65536").End(xlUp)).Name = "MyRange"
    With wks3.Range("Range3")
        .SpecialCells(xlBlanks).EntireRow.Delete
        .AdvancedFilter Action:=xlFilterCopy, copytorange:=wks3.Range("Range6"), unique:=True
        On Error Resume Next
    End With
    
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    hydrojoe11,

    Please read forum rules and message to cross posters below and then add the link to the other forum

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-16-2007
    Posts
    16

    Posted in other forum..posting here because i can't upload the worksheet.

    http://www.mrexcel.com/forum/showthr...=1#post1507622

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thank you.

    If that's the only problem upload the file to this site and post the link

    http://www.savefile.com/

    VBA Noob

  5. #5
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    VBA NOOB, why are you advising the Op's post the file to an alternate site and apste a link here when they can just zip the file and post it here?

    It seems to be a conflict of interest to me!
    Not all forums are the same - seek and you shall find

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    He's had a lot of replies on his thread and should continue it there.

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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