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 code execution speed question

i have code that opens about 12 workbooks and scans for a value in a cell
and then copies that line to the report sheet. all of the usual settings set
to false and my code runs fine, finishes in about 7 or 8 seconds.

but have a question.

if i have the vb window open, click the run button to run the code, it
slows down and i can see all of the code windows for each workbook open.
report takes about 14 or 15 seconds and i can see it scroll through the 56
lines in each sheet in the immediate window. they scroll really fast.

but if i click the control toolbox button on the report sheet itself, the
report takes about a minute to run and i can see the row numbers as they
scroll by very slowly.

what's the difference between hitting the run code button in vb and clicking
on the button on the sheet?

sure is a big difference in code execution time.
--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default code execution speed question

Gary
Code often runs slower if the VBA window is open, possible reasons include
screen updating the VBE
The compiled state of your code
If you are saying calling from a button on the worksheet is even slower then
maybe there is some other screen refresh going on there too.
Generally I use the native Excel controls as they seem more reliable than
the activex ones.
Interesting observation though
cheers
Simon

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i have code that opens about 12 workbooks and scans for a value in a cell
and then copies that line to the report sheet. all of the usual settings
set to false and my code runs fine, finishes in about 7 or 8 seconds.

but have a question.

if i have the vb window open, click the run button to run the code, it
slows down and i can see all of the code windows for each workbook open.
report takes about 14 or 15 seconds and i can see it scroll through the 56
lines in each sheet in the immediate window. they scroll really fast.

but if i click the control toolbox button on the report sheet itself, the
report takes about a minute to run and i can see the row numbers as they
scroll by very slowly.

what's the difference between hitting the run code button in vb and
clicking on the button on the sheet?

sure is a big difference in code execution time.
--


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
Unwanted code execution Rick Excel Discussion (Misc queries) 2 March 26th 10 02:14 PM
Execution speed for UDF Christian[_5_] Excel Programming 0 September 28th 04 04:20 PM
Extremely Slow VBA Execution Speed Joe Adams[_3_] Excel Programming 3 May 15th 04 01:23 AM
MACRO execution speed ericd Excel Programming 3 March 2nd 04 03:06 PM
VBA: Pausing Code Execution Michael Loganov Excel Programming 2 September 14th 03 10:53 AM


All times are GMT +1. The time now is 05:52 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"