I have a bunch of UDFs in my spreadsheet. When I'm debuging my code they recalculate a bunch of times. Is there a way to prevent my editor from stepping through that part of the code?
Printable View
I have a bunch of UDFs in my spreadsheet. When I'm debuging my code they recalculate a bunch of times. Is there a way to prevent my editor from stepping through that part of the code?
tA couple of things I do; if the calculations aren't important to the debugging of the current vba development and the functions end up being called a lot, I change the name of those funcions by adding a 'x' or two.
You could try setting calculation to manual.
If it is vital the udf code is executed then when you find yourself stepped into such a function, Ctrl+Shift+F8 gets you back to your debugging code.
You can also step through you code in jumps by putting the cursor on where you want the code next to stop and pressing Ctrl+F8 (or putting a break point there, or even a Stop instruction in he code)
When debugging, rather than Step Into (F8), Step Over (Shift-F8).
Thank you for the assistance. The ctrl+f8 and ctrl+shft+f8 is something that I did not know about. I currently just write a stop instruction like you suggest. So I take it that there is no way to ignore stepping through certain pieces of code that you write, like an excel function? Like a tag that tells the editor to just ignore stepping through a certain piece of code?
Password protecting a module would have been my guess, but i don't know how to protect just one module.
Shift-F8 steps over it as I said, It still gets executed, you just don't step through it.
When debugging, I find the RunToCursor option useful for running subroutines without stepping through each line.
Debug.Assert is also very useful, I use it all the time, because it is conditional.
Hey, I found an interesting way to solve this problem.
[VBA]
Application.enableevents = false
application.enableevents = true
[/VBA]