Debugging Help

D

David

Has anyone got any good tips for debugging VBA?

I've got a complex piece of code and I've tried using MsgBox which is
OK, but not ideal as I can't look around the Worksheets while the box
is displayed.

Any useful commands or other methods that can be use?

Thanks!
 
G

Guest

a few suggestion

1) add print.debug a and see results in immediate window. You need to go to
view menu and add immediate
2) Add break points using F9.
3) Step through code using F8.
4) Add variable to watch window.
5) For large loops add extra code

For RowCount = 1 to 1000

'added test code
if rowCount = 247 then
'set break point here
a = 1
end if
' end of test code

next RowCount
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top