+ Reply to Thread
Results 1 to 5 of 5

Pasting takes time

  1. #1
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Pasting takes time

    Hi,
    I have an issue with slow pasting of multiple ranges.

    As an example a part of the code in a larger sub:

    Please Login or Register  to view this content.
    If I paste the formulas to values, the macro runs instantly.
    If I leave the formulas as they are, it takes about 5 seconds to paste one worksheet, but I have to copy and paste many worksheets after each other, so 5 sec takes too long.

    I have set screenupdating off and calculation to manual.
    The worksheet 'sheet' is from another workbook with lots of formulas on it. Recalculation of that sheet takes about 1 full second, BUT... as I have calculation set to manual

    How can I speed up the code ?

    Thanks for helping me out here...
    Arnold

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Pasting takes time

    Is this form any faster?

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Pasting takes time

    Hi Jakobshavn,

    Thanks for your reply.
    It actually does run seconds faster. The whole test sheet took 17 sec and that is now reduced to 12 sec.

    However I would like to only paste the values and not the formatting along with it.
    I am not using xlPasteValues anymore. Is there a way to do that with your code?

    Arnold

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Pasting takes time

    Maybe..................What is the "shape" of targetRange? Is it a row or a column or a rectangle??

  5. #5
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Pasting takes time

    It is a table where I paste in three ranges of filtered cells with the same amount of rows.
    So in my example A3:A1200,C3:C1200,F3:F1200 will be pasted into the table in cell A2 (A1 is the table header).
    Range A3:A1200 will go to target sheet A2:A1199
    Range C3:C1200 will go to target sheet B2:B1199
    Range F3:F1200 will go to target sheet C2:C1199

+ 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. [SOLVED] Time Formula, time it takes to calculate
    By sans in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-16-2023, 08:23 AM
  2. [SOLVED] Formula that takes takes out a specific word/number from text string
    By ncalvelo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-29-2012, 10:21 AM
  3. Get time it takes to run program!!
    By cjsasl in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-11-2005, 05:35 PM
  4. Excel takes along time to calculate
    By TonyL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Excel takes along time to calculate
    By TonyL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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