+ Reply to Thread
Results 1 to 8 of 8

VBA - copy/paste no duplicates

  1. #1
    Registered User
    Join Date
    01-18-2014
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    39

    VBA - copy/paste no duplicates

    i need to take 6 columns from sheet 1 and paste theme in one list in sheet 2 activated with a button on sheet 2
    P/S i need the list on sheet 2 to exclude duplicates.
    thank you for your help.

    i have done this with an array formula but i believe a macro would be simpler
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA - copy/paste no duplicates

    Hello K-Ching,

    Please could you define what you would consider "Duplicates" within the range at question, since there are none as far as I can see.

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    Iran
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: VBA - copy/paste no duplicates

    hi

    if you want to have just one of duplicate with no duplicate items use this code for a button in sheet 2

    Please Login or Register  to view this content.
    if you don't need duplicate , i mean just unique item use this code :

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-24-2013
    Location
    Iran
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: VBA - copy/paste no duplicates

    finally if you want to clear your column A in sheet 2 after each press this button
    use this code after this line in above codes :
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-18-2014
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: VBA - copy/paste no duplicates

    Thank you button works fine but both codes have duplicates

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: VBA - copy/paste no duplicates

    Hi -

    try in button

    Please Login or Register  to view this content.
    event
    Last edited by event21; 01-20-2014 at 01:34 AM. Reason: kalak pointed out the resize..thanks

  7. #7
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: VBA - copy/paste no duplicates

    dictionary keys and items are zero-based arrays, so in second last line of above code use

    Resize(UBound(.items)+1).Value = ...

    or, shorter, just

    Resize(.count) = ...
    (coz dic items default as values anyway so .Value not needed)

    otherwise may miss out the 958

  8. #8
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: VBA - copy/paste no duplicates

    Hi kalak -

    I have updated my post, thanks

    event

+ 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. Macro/VBA to Search, Copy, Paste - without creating duplicates
    By rdesio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2013, 02:39 PM
  2. [SOLVED] Copy & Paste Duplicates
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2013, 11:56 PM
  3. Copy/Paste duplicates from multiple columns
    By sush23 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 08-22-2012, 08:34 PM
  4. VBA- search duplicates, copy+paste row, delete row
    By Hammi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2011, 01:02 PM
  5. Copy/Paste Remove Duplicates
    By Rage in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2009, 07:38 AM

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