7 Pro Tips for using the VBA Editor
Вставка
- Опубліковано 2 сер 2024
- 👉 Ready to master VBA?
- Check out my full courses: courses.excelmacromastery.com/
- Subscribe to the channel here: bit.ly/36hpTCY
- FREE CHEAT SHEET: Get the free cheat sheet on VBA arrays here: bit.ly/2MXsnz9
(Note: If the download page doesn't work then make sure to turn off any popup blockers)
The 7 Vital Areas of the VBA Editor
In this video I going to show you the vital parts of the Visual Basic Editor for VBA.
As this is the main tool for creating VBA code it is vital to Understand it.
Useful VBA Shortcut Keys:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
Tab: To move lines of code to the right(Indent).
Shift + Tab: To move lines of code to the left(Outdent).
Shift + F2: Get the definition of the item under the cursor.
Ctrl + Shift + F2: Go to the last cursor position.
Ctrl + Space: AutoComplete Word.
Alt + F11: Switch between Excel and the VBA Editor.
Ctrl + G: view the Immediate Window
Ctrl + R: View the Project Explorer Window.
Ctrl + Shift + 8(or Ctrl + *): Get the current region on a worksheet.
F4: View the Properties Window.
F5: Run the code from the current sub.
F8: Step into the code.
F9(or click left margin): Add a breakpoint to pause the code.
Table of Contents:
00:00 - Introduction
01:08 - 1. Understanding the Main Windows
03:19 - 2. Mastering the Modules
06:00 - 3. Bossing the Bookmarks
07:11 - 4. Taming the Toolbars
08:31 - 5. Winning with Windows
10:43 - 6. Dominating the Debug Menu
11:42 - 7. Ruling the Run Menu
After viewing several of Sir Paul's videos, I think that this is an excellent starting place.
Most useful video yet. We tend to get so bogged down in coding that we grit our teeth and do everything the hard way.
Day by day... This channel is becoming more and more awesomeee
Thank you Paul :)
Another very useful shortcut during debuging is: SHIFT + F2 (go to function, sub, variable etc. ==> Definition) and SHIFT + CTRL + F2 (go back to last position)
I enjoyed this one, going back to basics was good fun
THank you Paul for your job here. You helped me alot with my job and i am so greatful for that. Keep going good work!
Another very good Video, I am getting there slowly. Thanks Paul.
You are very welcome Colin
Great tutorial! Thank you, Paul!
Thanks Celia
Thank you, the tricks was verry important for me thath works daily wuth VBA. Other important shortcut is the F8 thath debug step by step the code.
Good review!
Nice vid. I am still waiting regular expression part 3 the quantifier. particular with how the *? work! Thanks for the pro video
Thanks, Paul
Thanks, Paul, I found it very helpful, particularly the bookmarks. Regards,
John
Thanks John
Where have you been all my life? 😍😍😍
Great overview my homeland Irish brother
Thanks Joey.
Any tips for dealing with the crippling alcoholism that working with the VBA editor induces?
Visual Studio editor mostly same too.
What are the drop downs "General" and "Read Data"?
Do you know if it's possible to use an alternative VBA editor in Microsoft Office applications? The problem with the default VBA editor for Office is that on high resolution monitors it is impossible to increase the font size to the code area. I tried changing the font size on the menu TOOLS - OPTIONS - EDITOR FORMAT, but it didn't work. The command wasn't accepted. Somehow the font size to code area in default VBA editor is directed related to monitor resolution.
Very informative...I have one question...what is the use of insert procedure? What is the use of comment mentioned while inserting the procedure?
Insert Procedure in the menu. It's a shortcut to create a procedure.
Hi Paul.. thanks for posting this video.. very helpful. I especially like CTRL+F6 to cycle through the project objects and SHIFT+F9 for Quick Watch on a variable, as well as toggling Bookmarks for quick navigation. Thanks for those great tips!. I discovered something interesting about CTRL+F6. I anticipated an orderly cycling through each project object in the list from top to bottom. But, it depends on the order in which you have opened your code windows. If you want a "normal" cycling from the highest item on the object list to the lowest, then you have to open your modules from the bottom of your list to the top. If done in that fashion, then CTRL+F6 will cycle you vertically through your object list from top to bottom. Also, SHIFT+CTRL+F6 will reverse the cycle.. bottom to top. If you don't do it this way, then successive pressing of CTRL+F6 jumps you through the object list in the reverse order of the opening of the code windows which seems somewhat random and not that helpful if you anticipate an orderly cycle. Kind of weird behavior.. but it is what it is. Also, another sequence I have put to memory is ALT, D, L to do a Debug => Compile before I run my code. Not technically a shortcut, but a handy key sequence to memorize and make part of your working discipline. Thanks again for all the great videos. I love the deep dive webinars and all the resources on your web site. These short 10-15 minute lessons are just right to pull over, take a break, learn something new, and then get back to work. Keep them coming.. very much appreciated and valued. I've told many of my colleagues to head directly to your web site and UA-cam channel if they want to learn VBA the right way! Thumbs up!!
Hi Wayne.
Thanks for pointing out the Ctrl + F6 behaviour. What I do is to try to keep 2 or 3 modules open at a time so Ctrl + F6 flips easily between them.
I think Alt + D + L can count as a short cut. It's useful just like Alt + V + H for the watch window.
-Paul
Hi Paul
When I press F8 it will move one by one line in vba editor page
How it will move my arrow in one row up ( need keyboard shortcut key )
I urgently need a function that bolds a text In VBA . any idea will be helpful. Thanks guys
"M astering the M odules", "B ossing the B ookmarks", "T aming the T oolbars" I see what you did there!! lol
Hi Paul. Nice Video. I have a question For you. I have Microsoft office 2013 and 2016 versions. i didn't install 2019 version yet. Anyway, when I add the edit toolbar from the custom dialog box it will disappear, when I reopen the workbook but not all the time. This happens in both versions. Can you help me with this issue. Thanks One of your Subscribers
Paul,
I have a question I wanted to get your opinion on when it comes to types of calculation in Excel. I was wondering what the best way to get in contact with you would be?
My email is Paul at ExcelMacroMastery.com
Somewhat off-topic, but can't find a better place to ask this question: Is it possible to change the font used in the Property Sheet dialog itself? I would like to increase the font size to help these old eyes from having to squint while modifying controls on the various forms and reports. It's actually in MS Access VBA instead of Excel, but I imagine it operates the same.
I haven't used Access in years. If you google it I'm sure there's a way to do it.
Sir, How local, watch and immediate windows are different from each other, please?
*Local automatically adds variables from the current sub.
*Watch requires you to add the variables yourself but the can be configured.
*Immediate window is used to print results which helps to test the code.
Dear Sir. I have a problem with my Properties Window having relocated itself as an independent window and I cannot get it back to it' original position under the Projects Explorer window as it appears in your video here. Can you please help me on how to reset this?
Thank you
Double-click on the top bar of the window to dock it in it's last position.. You can also drag the window to dock it.
MZ Tools is my favorite too! Isn't there a short cut to compile?
Alt + D + L or Alt + D + Enter
@@Excelmacromastery Thanks! Hope you didn't had to try out all the combinations on your keyboard LOL
Hello,
is it possible that an Excel VBA project convert to file with .exe extension. if it is can you make a video about that. Thanks!
There are third party tools that do this.
While on the VBE editor ... show people how to add the Comment and Uncomment commands. They should really be standard in the editor
.