performance question

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

i am using a for loop to copy some data, well not actually copy.
this is one example:
ws2.Range("G" & z) = ws.Range("C" & endRow)

if ws2 is the active sheet, it runs very fast. if ws is active, it is a lot
slower.

just wondering why?
 
i forgot to add one other thing.

this is without application.screenupdating = false at the beginning of the code.
with it in there, they are about the same.

wondering why it makes such a difference depending on which sheet is active. i
would have though that it would be faster if the sheet i was copying to, ws2,
was active.
 
Gary,

Is EndRow a different number depending on the sheet? I'm sure that's not
intended, but I wonder if it is.

Doug
 
Gary,

What I meant was, does the value for endRow change depending on which sheet
is active? That might explain the difference in time. I'm not sure what
you meant in your reply.

Maybe you should post more code.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top