+ Reply to Thread
Results 1 to 5 of 5

Fastest code to copy a range down

  1. #1
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Fastest code to copy a range down

    Hi,

    What is the fastest code to copy a range down a specified number of rows?

    The range to be copied down is named "TestSource" and is 2 cells next to each other on the same row. The number of rows to be copied down is in the range name "TotalRows".

    I was playing with the following code, but couldn't figure out how to plug in "TotalsRows". Am I on the right track?

    Please Login or Register  to view this content.
    Lawrence
    Last edited by skysurfer; 05-07-2010 at 07:54 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Fastest code to copy a range down

    Hello skysurfer,

    If you only need the values copied then the fastest method is assigning one range's value property equal to the other range's value property. The ranges must have the same number of rows and columns for this work.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: Fastest code to copy a range down

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 05-07-2010 at 07:09 PM.
    _________________
    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!)

  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: Fastest code to copy a range down

    Or your original syntax:
    Please Login or Register  to view this content.

    ...or even:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: Fastest code to copy a range down

    All you guys are amazing! Those answers gave me some VERY cool options.

    Thanks,

    Lawrence

+ 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