Avoiding bugs or errors means you have to be precise when writing code in a programming language. Luckily, using these shortcuts will debug code quickly in VBA:

Action Shortcut Key
Toggle breakpoint F9
Step into F8
Step over Shift+F8
Step out Ctrl+Shift+F8
Run to cursor Ctrl+F8
Clear all breakpoints Ctrl+F9