×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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€$

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

(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

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

(OP)
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€$

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

2020

combo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close