Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range()=OtherRange() vs .Copy Destination:= 1

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
0
0
GB
Good morning and Merry Christmas Eve.

Just asking myself the question as to which might be more efficient than the other, a or b. And do I need the .Value?

Code:
a) Sheets("Data").Range("C" & d).Value = Sheets("Somerset").Range("A" & r)

b) Sheets("Somerset").Range("A" & r).Copy Destination:=Sheets("Data").Range("C" & d)

Many thanks,
D€$
 
(A) should be faster, you can execute both in loop and check the speed.
Note that:
1) Value is the default property of Range object, it will be used if you skip the full path,
2) Value has some quirks for currency formats, instead, Value2 is faster and always refer to cell's real value,
3) in (b) you copy formulas and formats, it behaves differently to (a).

combo
 
Thank you combo. CHRISTMAS DAY!?!?!? Ha ha! [smile2] I had a suspicion that 'Value' was "better". It's only a small bit of code so I've amended all to 'Value2'.

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top