Tracking progress of a macro

HankJ

Board Regular
Joined
Mar 5, 2016
Messages
89
I hope explain myself clearly first time.
I have inherited a macro over 3000 lines long with 17 sub routines in it.
I have a small scale project to understand how it works.
At the moment I am working through hitting F8 repeatedly, until I get to a clear loop where I am putting a Stop and then F5ing.
Is there any way I can put markers into the code to run it and see where it went with the sample data I have used for it to process.
Sometimes the macro seems to fall over and lose itself. Not sure if this is because I gone off to see what is happening in the excel sheets.
Any suggestions would be great.
Many thanks for reading this.
Hankj
 
you can inserted in each module
application.statusbar = "some relevant text"

that will show you bottom left how ist going

you can right click in vba and add a break point, run the code to there and then F8 through the code,

if you have things like active,sheet and whilst the code runs you click through to a different sheet that becomes active and can cause problems

If you set break points just before the code falls over, then you can run it to there with F5 quickly
 
Upvote 0
Add a breakpoint. In the code press F9 to add one and a red dot will appear in the margin. The code will then run to that point
 
Upvote 0
no, and if you did it generally would be a real pain to work with. I'm not sure when they actually disappear

you can add text with an apostrophe, to search and to go back to a point to set the break
 
Upvote 0

Forum statistics

Threads
1,226,887
Messages
6,193,516
Members
453,804
Latest member
Daniel OFlanagan

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
Back
Top