+ Reply to Thread
Results 1 to 9 of 9

Find&Copy only copying 1 instance of match

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Find&Copy only copying 1 instance of match

    Hi guys,

    Can someone please tell me how to get my below code to not copy 1 match of the inputed item, rather all of them.

    At the moment if i enter 'Sarah' only 1 sarah is found when in reality sarah appears many times, though only 1 row is being copied with it.

    Thanks in advance,

    Please Login or Register  to view this content.
    Last edited by SarahPintal; 07-14-2010 at 06:38 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find&Copy only copying 1 instance of match

    Try this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Find&Copy only copying 1 instance of match

    Hi JB,

    It find all of them now though does not break out of the loop... i had to break out and when i looked at the results there was over 1000 lines, with about 100 instances of the same line.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find&Copy only copying 1 instance of match

    Time to post a sample workbook so we can see this stuff together. Click GO ADVANCED and use the paperclip icon to post up a desensitized copy of your workbook.

  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Find&Copy only copying 1 instance of match

    Sure thing; It is the second last sub.

    I have put dummy data into the report...

    thanks again
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find&Copy only copying 1 instance of match

    what's the password?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find&Copy only copying 1 instance of match

    Nevermind, I think an AutoFilter is a much faster method. Try this instead:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Find&Copy only copying 1 instance of match

    Worked like a charm - ill try my best to learn how you did this as this was very quick and clean compared to my find subs.

    Thanks

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find&Copy only copying 1 instance of match

    When evaluating the SAME column row by row, cell by cell for the same value, it's much faster to simply turn on the Data > Filter > AutoFilter and filter that column by the value you're searching for. Once the AutoFilter is on, non-matching rows are hidden so you can literally just copy the whole range and it will ignore the hidden rows...very cool, and much faster overall.

    Play around manually with the AutoFilter so you can see all the various things you can do with it.

    Cheers.

+ 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