Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default performance question

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?

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default performance question

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


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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?

--


Gary





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default performance question

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 Keramidas" <GKeramidasATmsn.com wrote in message
...
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


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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?

--


Gary






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default performance question

no, it's on the same sheet, but it keeps changing.

--


Gary


"Doug Glancy" wrote in message
...
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 Keramidas" <GKeramidasATmsn.com wrote in message
...
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


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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?

--


Gary








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default performance question

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

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
no, it's on the same sheet, but it keeps changing.

--


Gary


"Doug Glancy" wrote in message
...
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 Keramidas" <GKeramidasATmsn.com wrote in message
...
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


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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?

--


Gary











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default performance question

doesn't matter. my code runs fine i was just curious.

--


Gary


"Doug Glancy" wrote in message
...
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

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
no, it's on the same sheet, but it keeps changing.

--


Gary


"Doug Glancy" wrote in message
...
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 Keramidas" <GKeramidasATmsn.com wrote in message
...
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


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
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?

--


Gary











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance question Schizoid Man[_2_] Excel Programming 4 November 24th 06 10:38 AM
Performance IF(IF or IF(AND Paul Dennis Excel Worksheet Functions 2 July 20th 06 05:24 PM
XLL performance in NT and XP [email protected] Excel Programming 3 November 21st 05 10:36 AM
performance question Gary Keramidas[_2_] Excel Programming 5 July 16th 05 09:40 PM
Bad performance jim Excel Programming 2 January 30th 05 03:08 PM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"