Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Macro runs faster when VB code window open

I have a macro that runs quite fast when the Visual Basic code window is
open. But if it is closed takes a few minutes.

The macro reads one sheet and writes a in a second one when new data is
found for the report, I know is faster to read all data, fill up an array and
then write it all at once.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Macro runs faster when VB code window open

Hi

Start your macro with this line:

Application.ScreenUpdating=False

And this line before "End Sub"

Application.ScreenUpdating = True

If you need further advise, show us your code!

Regards,
Per
"Gerardo" skrev i meddelelsen
...
I have a macro that runs quite fast when the Visual Basic code window is
open. But if it is closed takes a few minutes.

The macro reads one sheet and writes a in a second one when new data is
found for the report, I know is faster to read all data, fill up an array
and
then write it all at once.

Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Macro runs faster when VB code window open

Thank you, I do have that code, but I don“t know why is different when the
code window is open.

I'm sorry, this macro is quite large to show and now with some more
experience I actually will do it differently, since i read that the problem
might be going back and forth between worksheets. I just don't want to star
over.

"Per Jessen" wrote:

Hi

Start your macro with this line:

Application.ScreenUpdating=False

And this line before "End Sub"

Application.ScreenUpdating = True

If you need further advise, show us your code!

Regards,
Per
"Gerardo" skrev i meddelelsen
...
I have a macro that runs quite fast when the Visual Basic code window is
open. But if it is closed takes a few minutes.

The macro reads one sheet and writes a in a second one when new data is
found for the report, I know is faster to read all data, fill up an array
and
then write it all at once.

Any ideas?



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
Macro runs in another workbook if you open simultaneously Priyanka[_2_] Excel Programming 2 February 3rd 08 06:58 PM
WHY the same macro runs so slowly on a different but faster comput Jerry Excel Discussion (Misc queries) 2 August 15th 07 10:30 PM
Which runs faster Barb Reinhardt Excel Programming 4 July 5th 07 06:06 PM
Macro runs upon wkbk open, but no Workbook_Open or Auto_Open Macro Ron Coderre Excel Programming 2 September 26th 06 05:50 PM
macro only runs on fresh open of excel? Jake Marx[_2_] Excel Programming 0 September 19th 03 04:15 PM


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

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

About Us

"It's about Microsoft Excel"