Slow Code, Please help !

Tridiro

Board Regular
Joined
Apr 26, 2007
Messages
97
Hello Everyone, I need some pointers on tracking down some slow code. Is there a method to see which line of code is causing my module to run really slow. Very thing was find and it was performing perfect, then suddenly it went from 1 second to run the code to 15 seconds. I have found that its considerable slower when I'm filtering data. its also inputting data into hidden cells. is there any known issues or causes when filtering data ?
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

bfarley4

New Member
Joined
Jul 20, 2010
Messages
32
When I notice my code is running slower then I like - I usually put in a couple of Msgbox lines denoting it has passed a certain spot in the code until I identify the item in question. If you want more specific insight - you might want to paste in your code.

Have you turned off the screen updates (just remember to turn them back on as it make Excel unstable).
 

Hooi

Board Regular
Joined
Jun 14, 2010
Messages
203
Hello Everyone, I need some pointers on tracking down some slow code. Is there a method to see which line of code is causing my module to run really slow. Very thing was find and it was performing perfect, then suddenly it went from 1 second to run the code to 15 seconds. I have found that its considerable slower when I'm filtering data. its also inputting data into hidden cells. is there any known issues or causes when filtering data ?
You may open the macro and pressing F8 to try line by line
 

Tridiro

Board Regular
Joined
Apr 26, 2007
Messages
97
thanks, the msgbox is a good idea. not sure how to run it line by line
 

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
Tridiro,

Can you post your macro code?


At the beginning of your posted code, enter the following without the quote marks:
["code"]


'Your code goes here.


At the end of your posted code, enter the following without the quote marks:
["/code"]
 

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
You might find a clean up of the code helpful. Either via a custom add-in http://www.appspro.com/Utilities/CodeCleaner.htm or manually by saving code from each module to notepad and then re-importing. Then compile. Close Excel & open it again, without opening the VBE. [Once the VBE is opened, code will be slower.]
 

Watch MrExcel Video

Forum statistics

Threads
1,122,647
Messages
5,597,363
Members
414,139
Latest member
okela0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top