+ Reply to Thread
Results 1 to 8 of 8

Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sheet2

  1. #1
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sheet2

    I currently have a macro, which I recorded, that copies a column from sheet ("FinCen") and pastes it into a specific column in sheet ("ALL"). There are about 10 columns that I want to copy and paste, which takes a while because it does each one after the other. Is there a way to put them in an array and loop through to make the process run faster? A bit of the code is below.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    If the code of John H.Davis works, this also will works, I add it to give you an (new) idea.

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    These both make perfect sense. BUT, when I run this code, it gives me an error message "Runtime error 7. Out of memory"
    Any ideas?

    Also, I noticed that the codes you suggested will only copy and paste, but not paste link.

    Thanks in advance!

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

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    Instead of dealing with whole columns, let's just use the same number of rows as used in column K of FInCen.

    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!)

  6. #6
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    Thanks JBeaucaire!

    I'm not too familiar with the range format, but I'm assuming that Range("A2:A" & LR) takes the entire A column starting from A2 all the way until the last row, which has data?

    One error I've run into so far... Where LR is set, it gives me an error saying "Application-defined or object-defined error"

    Please Login or Register  to view this content.

  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: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    Can we look at this workbook with the edited code in it together? Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

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

    Re: Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sh

    Thanks for the feedback. Did you finally get it working?


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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