VBA Error Handling Explained in Plain English (with examples)

Excel Macro Mastery
Excel Macro Mastery
46.2 هزار بار بازدید - 5 سال پیش - 👉 Ready to master VBA?-
👉 Ready to master VBA?
- Check out my full courses: https://courses.excelmacromastery.com/
- Subscribe to the channel here: https://bit.ly/36hpTCY
- FREE CHEAT SHEET: Get the free cheat sheet on VBA arrays here: https://bit.ly/2MXsnz9
(Note: If the download page doesn't work then make sure to turn off any popup blockers)

VBA Error Handling Explained in Plain English (with examples)

Related Article: VBA Error Handling - A Complete Guide(https://excelmacromastery.com/vba-err...)

Useful VBA Shortcut Keys:
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
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
Auto complete word: Ctrl + Space

Shift + F2: Get the definition of the item under the cursor.
Ctrl + Shift + F2: Go to the last cursor position.
Alt + F11: Switch between Excel and the VBA Editor.
Ctrl + R: View the Project Explorer Window.
Ctrl + Shift + 8(or Ctrl + *): Get the current region on a worksheet.
Tab: To move lines of code to the right(Indent).
Shift + Tab: To move lines of code to the left(Outdent).
F4: View the Properties Window.
F9(or click left margin): Add a breakpoint to pause the code.

Table of Contents:

00:00 - Introduction
00:24 - Ensure the error settings are correct
00:55 - Remove all Compile errors
02:45 - Dealing with Runtime Errors
04:45 - The 3 Error Handling States
06:57 - On Error Goto 0
08:09 - On Error Resume Next
10:22 - On Error Goto [label]
15:18 - Cleaning up after an error occurs
17:54 - Turning off Error Handling
19:03 - Unwinding the code
21:19 - Error Handling in a Nutshell
21:23 - Recap
5 سال پیش در تاریخ 1398/09/22 منتشر شده است.
46,251 بـار بازدید شده
... بیشتر