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

КОМЕНТАРІ • 46

  • @houstonvanhoy7767
    @houstonvanhoy7767 3 роки тому +2

    After viewing several of Sir Paul's videos, I think that this is an excellent starting place.

  • @donepearce
    @donepearce 4 роки тому +1

    Most useful video yet. We tend to get so bogged down in coding that we grit our teeth and do everything the hard way.

  • @rrrprogram8667
    @rrrprogram8667 4 роки тому +2

    Day by day... This channel is becoming more and more awesomeee

  • @mike_case
    @mike_case 4 роки тому +1

    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)

  • @grahamparker7729
    @grahamparker7729 4 роки тому +1

    I enjoyed this one, going back to basics was good fun

  • @mariuszjarzyna7223
    @mariuszjarzyna7223 4 роки тому

    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!

  • @bungy1962
    @bungy1962 4 роки тому

    Another very good Video, I am getting there slowly. Thanks Paul.

  • @CeliaAlvesSolveExcel
    @CeliaAlvesSolveExcel 4 роки тому

    Great tutorial! Thank you, Paul!

  • @ricnr10hot
    @ricnr10hot 4 роки тому

    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.

  • @stevennye5075
    @stevennye5075 4 роки тому

    Good review!

  • @wongpeter4058
    @wongpeter4058 4 роки тому

    Nice vid. I am still waiting regular expression part 3 the quantifier. particular with how the *? work! Thanks for the pro video

  • @PrincePedia
    @PrincePedia 4 роки тому

    Thanks, Paul

  • @JohnOvens
    @JohnOvens 4 роки тому

    Thanks, Paul, I found it very helpful, particularly the bookmarks. Regards,
    John

  • @hereb4theend
    @hereb4theend 4 роки тому

    Where have you been all my life? 😍😍😍

  • @wellsnapyeah
    @wellsnapyeah 4 роки тому

    Great overview my homeland Irish brother

  • @pandapoo1879
    @pandapoo1879 Рік тому

    Any tips for dealing with the crippling alcoholism that working with the VBA editor induces?

  • @markbrad123
    @markbrad123 4 роки тому

    Visual Studio editor mostly same too.

  • @seanmahoney1077
    @seanmahoney1077 Рік тому

    What are the drop downs "General" and "Read Data"?

  • @Esclarecidos
    @Esclarecidos 3 роки тому

    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.

  • @aarulmozhi
    @aarulmozhi 4 роки тому

    Very informative...I have one question...what is the use of insert procedure? What is the use of comment mentioned while inserting the procedure?

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +1

      Insert Procedure in the menu. It's a shortcut to create a procedure.

  • @wayneedmondson1065
    @wayneedmondson1065 4 роки тому

    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!!

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +1

      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

  • @gunasekar4098
    @gunasekar4098 4 роки тому

    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 )

  • @bestscenes1469
    @bestscenes1469 4 роки тому

    I urgently need a function that bolds a text In VBA . any idea will be helpful. Thanks guys

  • @greggowaffles
    @greggowaffles 4 роки тому +1

    "M astering the M odules", "B ossing the B ookmarks", "T aming the T oolbars" I see what you did there!! lol

  • @danp6101
    @danp6101 4 роки тому

    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

  • @joeysola
    @joeysola 4 роки тому

    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?

  • @jacksonmacd
    @jacksonmacd 3 роки тому

    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.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому

      I haven't used Access in years. If you google it I'm sure there's a way to do it.

  • @kalpeshbhawsar4400
    @kalpeshbhawsar4400 3 роки тому

    Sir, How local, watch and immediate windows are different from each other, please?

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому

      *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.

  • @panagiotistheodorou4959
    @panagiotistheodorou4959 4 роки тому

    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

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому

      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.

  • @kimfucku8074
    @kimfucku8074 4 роки тому

    MZ Tools is my favorite too! Isn't there a short cut to compile?

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +1

      Alt + D + L or Alt + D + Enter

    • @kimfucku8074
      @kimfucku8074 4 роки тому

      @@Excelmacromastery Thanks! Hope you didn't had to try out all the combinations on your keyboard LOL

  • @thomasfergusen5144
    @thomasfergusen5144 4 роки тому

    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!

  • @byteseq
    @byteseq 4 роки тому

    While on the VBE editor ... show people how to add the Comment and Uncomment commands. They should really be standard in the editor

  • @tughanozsezer9332
    @tughanozsezer9332 4 роки тому

    .