ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Which is faster code... (https://www.excelbanter.com/excel-programming/314461-faster-code.html)

Marcotte A

Which is faster code...
 
I believe option one is faster. Can anyone confirm? The goal is to copy a
value from one cell (in one workbook) to a cell in another workbook.

1)
myrange1.value = myrange2.value

2)
myrange2.copy
myrange1.paste

(Note: I know the above code is incorrect syntax, but I think you get the
idea of what I mean.)

Frank Kabel

Which is faster code...
 
Hi
if you only need the values I'm quite sure the first one is faster

--
Regards
Frank Kabel
Frankfurt, Germany

"Marcotte A" schrieb im
Newsbeitrag ...
I believe option one is faster. Can anyone confirm? The goal is to

copy a
value from one cell (in one workbook) to a cell in another workbook.

1)
myrange1.value = myrange2.value

2)
myrange2.copy
myrange1.paste

(Note: I know the above code is incorrect syntax, but I think you get

the
idea of what I mean.)



kkknie[_248_]

Which is faster code...
 

For just a single copy/paste operation, there's not much difference.
For a bunch of them, the first way is much faster (I cleaned u
someone's code a year back to prove it!). The only difference (a
Frank mentioned) is that you will not get the formatting or formulas o
the copied cell, just the value.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=27171



All times are GMT +1. The time now is 09:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com