+ Reply to Thread
Results 1 to 7 of 7

[Performance] Transferring data from a cell from sheet1 to another cell on sheet2

  1. #1
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Question [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    Good morning everyone,

    I have a question regarding the performance of this 3 ways to move a specific data from a cell to another cell

    The first method that i have is this one

    Please Login or Register  to view this content.
    The second method would be this one :

    Please Login or Register  to view this content.
    And the last one, in my opinion ,the slowest one

    Please Login or Register  to view this content.

    My questions is :
    What is the best way (faster times / low resource consumption) to copy a cell value to another sheet in a specific cell?

    Thank you for your time,
    Alex

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    There is no best, but the second one is fast, but limited by copying values only. The last one is the slowest as it has to do more work by selecting, copying and pasting.

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    Why not write a simple loop to time this? It's not an accurate measure but will give results you can compare to see which is fastest.

    Please Login or Register  to view this content.
    The loop is there only because you would have a difficult time trying to get a time for one copy - but the second option would be fastest. Sending stuff to the clipboard is relatively slow.

  4. #4
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    Hey,

    Thanks a lot for the timer idea.

    Here is my response with the results:
    Copying from a sheet to another sheet from 1 to 1000 using this text in the cell "test_Test_test_test_test_Te" has the following times :
    Please Login or Register  to view this content.
    5.730469 seconds

    Please Login or Register  to view this content.

    0.015625 seconds

    Please Login or Register  to view this content.
    NOTE : This has a lot of windows flickers! not recommended

    4.4375 seconds



    Thanks for your time!
    Alex

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    This has a lot of windows flickers! not recommended
    It is generally accepted you turn off screen updating when running a macro - especially if it switches windows...
    Please Login or Register  to view this content.
    (Not forgetting to set it True at the end of the procedure.

    2 advantages:
    • Saves on the cost of headache tablets
    • Speeds the code up (rather a lot, depending on how much switching it does).

    Don't know if you really noticed, but a 365x speed increase between option 1 & 2 is a worthwhile improvement regardless what you are coding.
    Last edited by cytop; 04-13-2017 at 04:55 AM. Reason: Additional comment

  6. #6
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    I know about turning off screen updating by using that code, but from my experience that will go ugly very quick when someone updates the macro / modifies something.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: [Performance] Transferring data from a cell from sheet1 to another cell on sheet2

    OK - is just something I've used without problem for yonks

+ 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. Replies: 3
    Last Post: 09-24-2015, 08:20 AM
  2. How to skip 1 row while transferring data from sheet2 to sheet1?
    By mso3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-08-2014, 12:23 AM
  3. Copy Data from Cell in last Row [Sheet1] to another Cell [Sheet2]
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-22-2014, 12:44 PM
  4. [SOLVED] Help With Copy Data From Sheet1 Cell to Sheet2 Cell
    By gaspower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2014, 01:48 PM
  5. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  6. Replies: 1
    Last Post: 12-30-2012, 07:52 PM
  7. Macro to copy range of cell from sheet1 to sheet2 based on a cell value in sheet2
    By drgwhizz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2012, 10:39 AM

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