MENU

Fun & Interesting

How to Solve a VBA Error in Less Than a Minute

Excel Macro Mastery 79,989 4 years ago
Video Not Working? Fix It Now

👉 Ready to master VBA? - Check out my full courses: https://courses.excelmacromastery.com/ - Subscribe to the channel here: https://bit.ly/36hpTCY -Want to download the source code for this video? Go here: https://bit.ly/3GOSuS8 (Note: If the download page doesn't work then make sure to turn off any popup blockers) How to Solve a VBA Error in Less Than a Minute In this video I'm going to show you how to find a runtime error in less than a minute. When a runtime error appears it often leaves the user confused. Where should they start trying to track it down and find the cause? There are 4 simple steps that you need. Some are well known but some are secrets only known by professional VBA developers. Most people waste a lot of time trying to figure out where the error is and what is causing it. However, if you follow these 4 simple steps it will save you hours of wasted time. #VBaerror Useful VBA Shortcut Keys ======================== Debugging: Compile the code: Alt + D + C OR Alt + D + Enter Run the code from the current sub: F5 Step into the code line by line: F8 Add a breakpoint to pause the code: F9(or click left margin) Windows: View the Immediate Window: Ctrl + G View the Watch Window: Alt + V + H View the Properties Window: F4 Switch between Excel and the VBA Editor: Alt + F11 View the Project Explorer Window: Ctrl + R Writing Code: Search keyword under cursor: Ctrl + F3 Search the word last searched for: F3 Auto complete word: Ctrl + Space Get the definition of the item under the cursor: Shift + F2 Go to the last cursor position: Ctrl + Shift + F2 Get the current region on a worksheet: Ctrl + Shift + 8(or Ctrl + *) To move lines of code to the right(Indent): Tab To move lines of code to the left(Outdent): Shift + Tab Delete a Line: Ctrl + Y(note: this clears the clipboard)

Comment