Free Excel VBA Course #22 - Error Handling in VBA (On Error Goto/Resume)

  Рет қаралды 15,501

TrumpExcel

TrumpExcel

4 жыл бұрын

In this video, I will show you how to handle errors in VBA in Excel.
VBA has given us some tools and techniques you can use to handle errors and In some cases use these to your advantage.
There are statements such as On Error Goto or On Error Resume where you can specify what to do in case VBA encounters an error. You can ask the code to jump to a specific line of code or you can ask it to ignore the error and keep moving.
You can also use message boxes to identify and understand the errors better.
✅ Download File: bit.ly/vbacourse-22
☕ If you find my Excel videos useful and would like to support me, you can buy me a coffee - www.buymeacoffee.com/SumitB
Free Excel Course (Basic to Advanced) - trumpexcel.com/learn-excel/
Best Excel Books: trumpexcel.com/best-excel-books/
Subscribe to get awesome Excel Tips every week: kzfaq.info...
#Excel #ExcelTips #ExcelTutorial

Пікірлер: 26
@nobodyimportant5485
@nobodyimportant5485 2 жыл бұрын
Very helpful and concise! Thank you!
@ren_6130
@ren_6130 2 жыл бұрын
very comprehensive, thank you!
@douglashaffner1173
@douglashaffner1173 Жыл бұрын
This is amazing. Has saved me so much pain. Thank you so much
@bhushanpagade8673
@bhushanpagade8673 3 жыл бұрын
Thank you it helped me a lot.
@techkdeva8587
@techkdeva8587 3 жыл бұрын
Great effort
@Souhila-yi8qk
@Souhila-yi8qk Ай бұрын
Thank you for the interesting Video
@vijaysahal4556
@vijaysahal4556 4 жыл бұрын
amazing sir thankx 👍👍👍👍👍👍👍
@kalkool5504
@kalkool5504 Жыл бұрын
Perfect for me
@Vvvvixen
@Vvvvixen 3 жыл бұрын
Thank you!
@JATINKUMAR-qu4vi
@JATINKUMAR-qu4vi 2 жыл бұрын
Awesome video 👍
@margad-erdeneboldbaatar4704
@margad-erdeneboldbaatar4704 2 жыл бұрын
Thanks so much.
@bluejay12293
@bluejay12293 2 жыл бұрын
thank you
@rakeshthakur9403
@rakeshthakur9403 Жыл бұрын
Nice video
@ardhik3744
@ardhik3744 3 жыл бұрын
can i handle "runtime error 4605" with this method?
@redhaakhund1271
@redhaakhund1271 Жыл бұрын
👍👍👍👍👍
@kaustubhzende3553
@kaustubhzende3553 Жыл бұрын
how to exit the loop? I have no idea. Eventually i had to end the task via taskmanager. Any feedback is highly appreciated.
@surajrawat3152
@surajrawat3152 2 жыл бұрын
Can you help me what i am missing out in this code? after debugging showing run time error 13 "Number = InputBox("Enter numeric value")" area Sub errorhandling() Dim Number As Long On Error GoTo EntryError Number = InputBox("Enter numeric value") Range("A1").Value = Number EntryError: MsgBox "Please enter valid value" End Sub
@againagainagainagain.
@againagainagainagain. 11 ай бұрын
It's working fine. You should try in a new file.
@umamaheshk6151
@umamaheshk6151 3 жыл бұрын
In the following, when i run it, it takes alphanumeric value, numeric value, integer value. It didn't show error. Can anyone give me what I have done wrong? Sub ErrorHandling() Dim Emp_Name As String EName: On Error GoTo NameError Emp_Name = InputBox("Please Enter Employee Name") Range("b2") = Emp_Name Exit Sub NameError: MsgBox "Please Enter Numeric Value Only" Resume EName End Sub
@andrewtuinkwtuink
@andrewtuinkwtuink 3 жыл бұрын
I think you need to put '.Value' after the Range("B2").
@umamaheshk6151
@umamaheshk6151 3 жыл бұрын
@@andrewtuinkwtuink I also used ".value" but same error
@andrewtuinkwtuink
@andrewtuinkwtuink 3 жыл бұрын
@@umamaheshk6151 Employee name supposed to be Alphabeth right? String could handle alphabeth and number. If You want number only, You could use long. If this still give different results, wish someone notice this and give the right answer.
@umamaheshk6151
@umamaheshk6151 3 жыл бұрын
@@andrewtuinkwtuink Yes. But I want only alphabets in Name, then what I have to do?
@andrewtuinkwtuink
@andrewtuinkwtuink 3 жыл бұрын
@@umamaheshk6151 This solution from Warship at mrexcel Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If (KeyAscii < 65 Or KeyAscii > 90) And (KeyAscii < 97 Or KeyAscii > 122) Then KeyAscii = 0 End Sub
@chenclaire638
@chenclaire638 Жыл бұрын
It helped me a lot, thank you
Free Excel VBA Course #23 - Event Procedures in VBA
24:54
TrumpExcel
Рет қаралды 19 М.
The Basics of Error Handling in VBA
23:59
codekabinett.com/en
Рет қаралды 1,5 М.
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 11 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 3,4 МЛН
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 50 МЛН
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 106 МЛН
Free Excel VBA Course #11 - Using Data Variables in Excel VBA
16:42
Free Excel VBA Course #24 - Userform Basics in Excel VBA
15:08
TrumpExcel
Рет қаралды 12 М.
Free Excel VBA Course #15 - IF Then Else Statement in Excel VBA
11:44
VBA Error Handling Explained in Plain English (with examples)
23:13
Excel Macro Mastery
Рет қаралды 46 М.
Free Excel VBA Course #6 - Understanding Errors in VBA
10:28
TrumpExcel
Рет қаралды 27 М.
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 11 МЛН