#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Slow macro


Hi, I have a macro with 5 different userforms which will help the user to get
the correct input. When I run the macro by steps (F8) the macro runs OK, but
when i run the macro by (F5) the macro slow very much down in speed.

I think the problem is the Userforms, but I am not sure. I have been using
Userform.hide and unlode Userform to see if it speeds up the macro, but
result is negative. Any one who has any sugestions?

Johan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Slow macro


You may want to add some break point using F9 to help find out what part of
the code is running slow. Set a break point in the middle of the code and
then run F5. then Press F5 again to run the 2nd part of the macro. Check if
the part before the break point is taking long or after the break point.
Move the break point or add multiple break points to isolate where the code
is running slow.

"Johan" wrote:

Hi, I have a macro with 5 different userforms which will help the user to get
the correct input. When I run the macro by steps (F8) the macro runs OK, but
when i run the macro by (F5) the macro slow very much down in speed.

I think the problem is the Userforms, but I am not sure. I have been using
Userform.hide and unlode Userform to see if it speeds up the macro, but
result is negative. Any one who has any sugestions?

Johan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Slow macro


The macro as basic is searching for files on the computer and I know that it
is while searching the macro slowing down.
But I think, or it looks like , it have something to to with the user form
because it will no hide.
It seems that the macro not take its time to close the userform "properly"

Johan

Joel skrev:

You may want to add some break point using F9 to help find out what part of
the code is running slow. Set a break point in the middle of the code and
then run F5. then Press F5 again to run the 2nd part of the macro. Check if
the part before the break point is taking long or after the break point.
Move the break point or add multiple break points to isolate where the code
is running slow.

"Johan" wrote:

Hi, I have a macro with 5 different userforms which will help the user to get
the correct input. When I run the macro by steps (F8) the macro runs OK, but
when i run the macro by (F5) the macro slow very much down in speed.

I think the problem is the Userforms, but I am not sure. I have been using
Userform.hide and unlode Userform to see if it speeds up the macro, but
result is negative. Any one who has any sugestions?

Johan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Slow macro


After you unload all your userforms and set ScreenUpdating = True, put in a
"DoEvents" to force Excel to catch up. That should cause the userforms to be
hidden. The "Pause 10" won't do anything.

Are your file searches running across a network? If so, that can be very
slow and it may be something that you can't avoid.

HTH,

Eric

"Johan" wrote:

The macro as basic is searching for files on the computer and I know that it
is while searching the macro slowing down.
But I think, or it looks like , it have something to to with the user form
because it will no hide.
It seems that the macro not take its time to close the userform "properly"

Johan

Joel skrev:

You may want to add some break point using F9 to help find out what part of
the code is running slow. Set a break point in the middle of the code and
then run F5. then Press F5 again to run the 2nd part of the macro. Check if
the part before the break point is taking long or after the break point.
Move the break point or add multiple break points to isolate where the code
is running slow.

"Johan" wrote:

Hi, I have a macro with 5 different userforms which will help the user to get
the correct input. When I run the macro by steps (F8) the macro runs OK, but
when i run the macro by (F5) the macro slow very much down in speed.

I think the problem is the Userforms, but I am not sure. I have been using
Userform.hide and unlode Userform to see if it speeds up the macro, but
result is negative. Any one who has any sugestions?

Johan

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
slow macro :)[_2_] Excel Discussion (Misc queries) 1 March 3rd 10 02:41 PM
slow macro help DPingger Excel Programming 7 March 3rd 09 05:21 PM
Macro is very slow jlclyde Excel Discussion (Misc queries) 2 September 29th 08 04:43 PM
Macro help, very slow Scott Marcus Excel Programming 0 November 8th 06 05:39 PM
Slow macro alf bryn Excel Programming 5 August 5th 05 12:27 AM


All times are GMT +1. The time now is 07:12 AM.

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"