How to Solve a VBA Error in Less Than a Minute

preview_player
Показать описание
👉 Ready to master VBA?
(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)
Рекомендации по теме
Комментарии
Автор

Debugging has given me some serious headaches. I cannot thank you enough for your explicit breakdown. Your tutorials have been an education for me.

querrythis
Автор

Another great job Paul! It didn't solve my problem, but I learned a ton and am on my way! Thanks so much!

scottgaines
Автор

Paul, I have not used the watches window much at all, but after viewing this online seminar I am a converted fan and now will be using it a lot more. I cannot thank you enough for the excellent training I have received from you over the years and in particular your VBA course, which is awesome.

JohnOvens
Автор

I've been working with VBA for over a year, and every time I watch one of your videos I learn something new and invaluable that I wished I had learned long ago. They're all so clear and concise, and aimed at real every-day problems.

mcallister
Автор

Great job as always. Rather than bringing up the Watch window, you can get the value of any single variable by simply holding the cursor over the variable in the debug window. The watch window is then helpful if you need assistance finding or confirming the source of the data in that variable. I find if I am dealing with my own code the source is usually readily apparent and the watch window is not needed. When debugging someone else's code or my own code that I have not seen in awhile the watch window is used more often.

donstruble
Автор

Well structured walkthrough, especially of Break on All Errors and editing the Watch Window.

PROBeirne
Автор

Outstanding! This video is one of your very best Paul. I have struggled to use the Watch window effectively until now. Thank you & Well done!

tophercahill
Автор

King of error trapping!! Another good video.

srider
Автор

Great video and amazing way of explanation. It can come very handy

abdulhaseeb
Автор

thank you for this.... i know it will save me a lot of time

tuworlds
Автор

I really appreciate you explain everything in the simpliest way there is. There are lots of VBA tips on the internet, but only a little of it is understable. Please do more of your best - as always :)

mateuszbajko
Автор

every now and then if you are lucky you come across a gold nugget. This is one of those, I have used the watch window but can now see how much more useful it can be used...awesome tutorial.

gregnorthover
Автор

As watching every of your videos, I could enjoy it truly much! Thanks for your informative and easy tricks about error handling and reverse engineering light! Hope publishing your next video won't need so much times! I hope your fine and thank you!

johnwayne
Автор

ty, i actually solved my problem in under one min. gj brother

renaldomoon
Автор

Excellent, perfect way to debug. I sometimes use immediate window, if it is complex, watch window is ideal choice. Thanks for your efforts on making this content.

kishorekizz
Автор

Excellent, as always. Thanks for sharing.

vbaclasses
Автор

man, you're just incredible. i have learned a lot from you. great content, simply to figure it out. great examples, etc. i have done a lot of different tutorials but your is the best. your blog is super helpful. owing to you, I have understood: arrays, collections. big thanks from Poland

grzegorz
Автор

Fantastic as always, you are doing a great job

AnilKumar-vioe
Автор

Estoy aprendiendo bastante con tus videos gracias por compartir tus conocimientos.

gabrielvalmo
Автор

Excellent and very useful, thank you.

GopiNath-fply