Debugging Help

  • Thread starter Thread starter David
  • Start date Start date
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!
 
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
 
Back
Top