+ Reply to Thread
Results 1 to 2 of 2

The fastest routine to copy & paste ~350 rows if cell1 matches a dynamic criterion?

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    16

    The fastest routine to copy & paste ~350 rows if cell1 matches a dynamic criterion?

    Hi everybody!

    I've got to copy ~350 rows of data (individually) from one worksheet to another if the value of cell1 in the source row matches the cell1 value of the target row.

    At the moment I am running two "For ... Next" loops within each other

    Please Login or Register  to view this content.
    As you can expect, browsing through 2x 350 rows and updating each of them in this way is not really high-performance code.

    How would you tackle that? What's the fastest way to realize this?

    Happy to hear your ideas!

    Best regards,
    Andreas

  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: The fastest routine to copy & paste ~350 rows if cell1 matches a dynamic criterion?

    You can improve the "appearance" of efficiency by putting this above and below your loops:

    Please Login or Register  to view this content.

    You can use the Data > Filter to filter the data directly for all the rows matching the criteria, then move them enmasse. Your code appears to be parsing all the rows of data from one master sheet out to sheets that are named for those values. If that's true...



    'SHEET1 TO MANY SHEETS
    Here's a macro for parsing rows of data from one sheet to many sheets named for the same values in a specific column.It not only can parse the rows, it can create the sheets if they are missing. There is a sample sheet there where you can test this out.
    _________________
    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!)

+ 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