Sub Thanks(sReason As String) Dim NewLine as String NewLine=vbCrLf MsgBox("Thank you Sir" & NewLine & sReason) End Sub Call Thanks("You saved my life with that piece of code!!!")
@bpbeary8011
4 жыл бұрын
Terrific approach, especially as it retraces the entire stack of procedure calls. I've learned so much from subscribing to your channel. Cheers, Brendan
@Excelmacromastery
4 жыл бұрын
Thanks Brendan
@joetester4007
5 ай бұрын
This is really good stuff mate, thank you so much!
@manuelefe21
4 жыл бұрын
This the most useful strategy I have found on the internet. Unfortunately, it doesn't seem to work when you use it on userforms. When the error is found inside of a command button of a userform, the code stops where the err.raise line is located. That was very frustrating for me not to be able of using this powerful strategy in my code. Besides that... Thanks very much for your incredible job :)
@iincitr
4 жыл бұрын
Very useful You are the best Excel-related KZitemr. Thank you again. Mary Christmas.
@Excelmacromastery
4 жыл бұрын
Thanks Ismail
@thearchibaldtuttle
4 жыл бұрын
Merry X-Mas and an error free 2020!
@Excelmacromastery
4 жыл бұрын
Many happy returns Archibald.
@johnjacobjinglehimerschmid3555
4 жыл бұрын
😆😆😆😆😆😆😆😆😆😆😆 Had an "error free 2020" resolution. All ready broke it.
@hemant0088
4 жыл бұрын
Paul awesome content. You have given key value on VBA language. We have never come across such a useful error handling procedure. Merry X'Mas 😄😃😍 Big Thumbs up 👍👍👍
@Excelmacromastery
4 жыл бұрын
Thanks Hemant
@ryancagulang8728
Жыл бұрын
Thanks for this Paul. I hve learned a lot.
@karenjoy511
10 ай бұрын
'Just recently came across your excellent videos, so not sure if you're still reading comments. If so, I've tried a number of ways to implement your error handling code to no avail (put the ErrorHandling module into a sandbox, copied test routines from your website and ran them, but message box with error readout doesn't come up). Is there some way of determining what is missing? I'd love to replace my current, klunkier error handling with this technique. Thx!
@markspindler5321
Жыл бұрын
Excellent video. The problem with throwing errors is that with a large procedural subroutine, it is hard to know the cause. I have found that isolating a line of code that causes the error into a function that returns a boolean works in most cases because you can send the error to a label "eh:" in your function and return false to indicate that the function did not work correctly. I suppose you can have several labels and several goto labels as well. Is that possible? For me, isolating errors prone code into functions helps you ensure you know why your code is breaking and it allows you to control the next step.
@Fshhady
Жыл бұрын
Thank you my friend for the code file. It's great
@k0023382
6 ай бұрын
FYI, I have noticed the link to the code of this video (and some others) takes you to a broken link. Thanks
@alecmatias4774
2 жыл бұрын
Great video! Can you show how to use named range in vba and how to setup named range?
@scotolivera8207
4 жыл бұрын
You make VBA look easy 😃
@Excelmacromastery
4 жыл бұрын
Thanks George
@wayneedmondson1065
3 жыл бұрын
Thanks Paul!
@rahul7rock
4 жыл бұрын
Thank you Paul sir. Your videos are very informative and it has helped me to purify my codes. 🤗
@Excelmacromastery
4 жыл бұрын
Thanks a lot Rahul
@kishi3987
Жыл бұрын
Great content! Thank you for sharing your knowledge! My team has quite a few macros. Most of them open log files, read data, validates and extracts data on log files based on the position in the row. Then finally generats ouput files (log file) with the information based on the matched criteria. Most of the times because of extra spaces or characters macro not able to read data on source files (log files) and providing error messages. Could you please upload a video with log files and how to identify source file and the line of souce file where the error coming from? Thank you in advance!
@mike_case
4 жыл бұрын
Thank you Paul!!! I need to test it asap.
@Excelmacromastery
4 жыл бұрын
You are very welcome Michal
@stevennye5075
4 жыл бұрын
This was very helpful!
@Excelmacromastery
4 жыл бұрын
Glad to help
@valentinneufeld6182
2 жыл бұрын
This is awesome 👌
@kamatchinmay
4 жыл бұрын
Excellent strategy
@Excelmacromastery
4 жыл бұрын
Thanks chinmay
@jimmyvelasco1570
4 жыл бұрын
Hey! I've been following your channel for some time now, im from and in Perú, your videos are awesome, I just wanted to ask, in this method, I understand that it's only one error per sub in every run right?
@Excelmacromastery
4 жыл бұрын
Yes. But the code will exit at the first error so it wouldn't reach any other errors.
@jimmyvelasco1570
4 жыл бұрын
@@Excelmacromastery Niceee
@321tryagain
4 жыл бұрын
Helpful, thank you
@Excelmacromastery
4 жыл бұрын
You are very welcome
@bernardanim2381
4 жыл бұрын
Hi Paul, your tutorials are great! (I always recommend them to my friends). Thanks and keep them coming! Could you assist me to open the .bas file that has the code? Thanks in advance! And Happy Holidays!
@Excelmacromastery
4 жыл бұрын
Right click on the workbook in the project window. Select "Import File" and then select the .bas file
@bernardanim2381
4 жыл бұрын
@@Excelmacromastery Thanks!
@kevinbezant8972
4 жыл бұрын
Hi Paul, great video. Out of interest, why do you pass the parameters to RaiseError and DisplayError subs as ByVal?
@Excelmacromastery
4 жыл бұрын
It means that only the value is passed. So if the value is changed in the sub it will be changed in the original.
@123petz
3 жыл бұрын
Is there any requirement that you add declared constant vbObjectError value + 1 Const Error_Total_Value = vbObjectError + 1
@Meolimo
4 жыл бұрын
one word : Wow tks :-)
@Excelmacromastery
4 жыл бұрын
Thanks a lot Mario
@searchingyt4246
4 жыл бұрын
Hey Paul, Could you make a video about error handling within a while and for loop. On error do something and then jump to next loop iteration. That would be very helpful :)
@xaviercohen1124
4 жыл бұрын
Hi Paul, thanks a lot for your video, they are very useful... just one question please: I checked on my Excel when clicking any module(right click) in my VBA editor, I do not have the option "add line number"... I do not understand, I am currently using Excel 2016... thanks a lot in advance for your feedback...
@xaviercohen1124
4 жыл бұрын
I listened again your video, you said that you used MZ tool to do that but it is not free...but alternatively it is possible to program something ourselves...
@Excelmacromastery
4 жыл бұрын
It is possible to write your own code to do it but it's not trivial to do so.
@arjen421
3 жыл бұрын
Great video! The download link for the error handling code however seems to be dead. I'm just getting a white screen.
@Excelmacromastery
3 жыл бұрын
This is caused by using a pop up blocker like uBlock Origin. Try turning it off or using incognito.
@arjen421
3 жыл бұрын
@@Excelmacromastery I was indeed using ublock. Got it now and working great. Thx
@houstonvanhoy7767
3 жыл бұрын
00:12. Sir Paul recommends viewing the previous video on error handling kzitem.info/news/bejne/yIF_tX2Oq5uJeH4 before viewing this video. Do it!
@Naresh13Kumar
4 жыл бұрын
Hello how did u update the number to the code automatically, can we able create our own tool, like that as a developer tool to faster the code writing method!
@Excelmacromastery
4 жыл бұрын
I used a third party tool. You can write code to do it but it's advanced.
@sandeepkothari5000
4 жыл бұрын
Great going Paul. I downloaded the .bas file. How to open it?
@sandeepkothari5000
4 жыл бұрын
No seat Paul. I could open the bas file following your instructions in your email. Thanks a lot for the code, video & everything else.
@Excelmacromastery
4 жыл бұрын
Thanks Sandeep
@panagiotistheodorou4959
4 жыл бұрын
Open it with Notepad...
@mikemorrione8899
4 жыл бұрын
Does your error handling code work for access vba?
@Excelmacromastery
4 жыл бұрын
Yes.
@kailash680
2 жыл бұрын
Download is not possible, just a blank website.
@Excelmacromastery
2 жыл бұрын
Make sure to turn off any adblockers
@shreyasiparikh1544
3 жыл бұрын
Can you tell what is error If txt.Value = "" Or txt.Value = Field_Type Then MsgBox "Please enter the " & Field_Type, vbCritical Exit Sub End If Dim Search_range As Range Set Search_range = sh.Range(sh.Cells(2, Col_number), sh.Cells(Application.Rows.Count, Col_number)) If Application.WorksheetFunction.CountIf(Search_range, "*" & txt.Value & "*") = 0 Then MsgBox "No Match Found", vbCritical Exit Sub End If Dim iRow As Long If Application.WorksheetFunction.CountIf(Search_range, txt.Value) > 0 Then iRow = Application.WorksheetFunction.Match(txt.Value, Search_range, 0) + 1 Else iRow = Application.WorksheetFunction.Match("*", & txt_value & "*", serach_range, 0) + 1 End If
@engrvarsi3774
4 жыл бұрын
5:03 ?😜 Unexpected laughters... 😂😂😂😂
@chrisedwards670
4 жыл бұрын
Unable to download the code page times out This site can’t be reached bit.ly took too long to respond.
@Excelmacromastery
4 жыл бұрын
I just checked it an it seems fine. Are you using a VPN by any chance?
@sane7263
3 жыл бұрын
the website never works !
@Excelmacromastery
3 жыл бұрын
Which website?
@vladyslavtverezyy2242
4 жыл бұрын
Hello. If i have the next Macro: Sub Copyrenameworksheet() 'Updateby Extendoffice 20160704 Dim ws As Worksheet Set wh = Worksheets(ActiveSheet.Name) ActiveSheet.Copy After:=Worksheets(Sheets.Count) If wh.Range("A1").Value "" Then ActiveSheet.Name = wh.Range("A1").Value End If wh.Activate End Sub Home can i add an MsgBox that write "Sheet already exists"?
Пікірлер: 71