Excel VBA Introduction Part 1 - Getting Started in the VB Editor

Excel VBA Introduction Part 1 - Getting Started in the VB Editor Welcome to this wise ell tutorial in this video we're going to teach you about working with the visual basic editor application with a name to writing some Excel VBA code in this.

Excel VBA Introduction Part 1 - Getting Started in the VB Editor

Video we're not going to write any code itself but we are going to do is show you how you can set up and work with the visual basic editor so I'll start by showing you how you can access the VBA.

Deter from whichever version of Excel you happen to be working in we'll talk about how you can switch between the the VBA editor and Excel itself with some nice quick keyboard shortcuts we'll also.

Give you a quick whirlwind tour of the VB screen and explain what the main window is in the VB editor application now for once we've covered that we'll move on to show you how you work with.

Modules which are the places where you're going to write your code so I'll talk about how you can create and remove modules how you can switch between the various ones you've created how you can.

Rename them and finally how you set up the fonts and colors that you're going to use while you're actually programming so let's get started before you can start writing VBA code you first of all.

Need to open up the visual basic editor application and the way that you do that depends on which version of Excel you happen to be using if you're in Excel 2003 you can quite simply head to the.

Tools menu find the macro option in there and then click the visual basic editor option there too you'll probably find that a guess a bit annoying having to go through this menu every time you.

Want to get to that option so alternatively you could also display the visual basic toolbar in Excel to do that you'd need to right-click somewhere at the top of the screen where all the.

Existing little bars are choose visual basic and then I'm going to drag this and nest it up at the top of the screen like all the little buzz you should find on there that there's a symbol button.

You can click on to take you to the visual basic editor and there it is to get into the VB editor in Excel 2007 I first of all need to display the Developer tab in the ribbon at the top.

Of the screen and to do that I need to go to the office button at the top left hand corner choose Excel options and then on the popular page of the dialog box that.

Posts Related:

    I'm looking at find the checkbox which - Make Automate

    Says show Developer tab in the ribbon check it and then click OK you should find that there's a new tab in the ribbon now called Developer and if you.

    Go to that one the very first button on there visual basic clicking it will take you to the VBA editor yet again if you're in Excel 2010 or 2013 you also need to display the Developer tab in the.

    Ribbon but the way you do it in these two versions of Excel is slightly different to 2007 what you need to do is right-click on any existing ribbon tab choose customize the ribbon and then on.

    The dialog box which appears find the uncheck box next to the word Developer check it and then click OK once again you'll find the Developer tab appears in the ribbon and if you select it you'll.

    Be able to click on the first button there visual basic to take you once again into the visual basic editor whichever version of Excel you happen to be using when you want to switch back.

    Into Excel itself you can simply click on the first button on the VB editor toolbar it looks like a little Excel icon if you click on that it takes you straight back to Excel you can also just.

    Use the taskbar although you can't see it on my screen if I hover my mouse at the bottom of the screen it will pop up with the two icons related to the two applications so you can simply click on.

    Either of those two to switch you between the two applications you might also have noticed while I've been recording this a little bit of the video that when you hover the mouse over.

    Certain icons it displays a tooltip so you'll see the Alt + f11 keyboard shortcut will allow you to switch backwards and forwards between the two applications if you hold down the Alt.

    Key and then press f11 you know Allison

    From switching between the two applications so onto the VBA editor itself how does the application work well it's a fairly standard looking.

    Microsoft Office application although it uses the old-school menus and toolbars system you should be reasonably familiar with would be able to click on menus to choose options and come buttons on.

    Toolbars to make things happen one thing that is quite different about the VBA editor compared to other Microsoft Office applications is the number of windows that it uses little individual.

    Panels which display different bits of information now these two windows you can see at the moment the project Explorer and the properties window but the two that were always displayed by.

    Default but there are many more available and you open and close them as and when you want to if you close down a window or two you'll always be able to find them again from the View menu so I.

    Choose the View menu I can find my project explorer which I've just closed down and also my properties window there will always be a keyboard shortcut available to open these as well so I.

    Have four four properties control an R for the project Explorer it's also possible to move the windows around from their current positions and you can do that by simply clicking and.

    Dragging on the title bar window so I click and drag on the properties window you'll see that I get a thin outline border which changes to a thick outline border as I under Commissioner.

    Release the mouse I've now got a free floating window which sits can can be positioned anywhere on the screen you can also dock it to different positions so if I start dragging it across to the.

    Right and watch for when the thick gray border changed to a thin gray border instead I'll find that I can release the mouse button now and it will sit in and nest itself to another part of the.

    Screen so you can feel free to play around with this docking it to various regions until you find a nice layout for the way you want to work it can be a little bit tricky getting that back into.

    Its original position in actually so I undock it from the bottom of the screen where it currently is and start to draw like it towards the left-hand edge but I think it should be when it.

    Changes from thick to thin if I release the mouse button by default it soon as you go back into its original position so that way you where you release the mouse button is very very important here.

    I've found massive difficulties doing this in the past so for this one let's see if I can get it back in the right position if I drag it down towards the bottom that left hand panel there we go.

    Guys from thick to thin there and I've released the mouse button I just need to change the size and the height of that window now by clicking and dragging in between them there we go back to roughly.

    Its original position if we want to write some VBA code we need somewhere to write it and the best place for that in the visual basic editor is in something called a module.

    You can create modules in a couple of different ways one method uses the project Explorer window at the top left-hand corner of the screen if you right-click with a mouse anywhere.

    Inside the project you're working on you can choose to insert a module when you do so your module will appear as a separate floating window somewhere in the middle of the screen and your.

    Project Explorer create a modules folder with a little icon representing the module you've just created another way to create a module is to use the insert menus if you choose insert module that.

    Will create a module for you as well so you get another icon representing now module and another separate floating window in the middle of the screen you can close these windows down happily by.

    Clicking the crosses in the top right hand corner and you can double click on the module to redisplay it you can also maximize a module by clicking the the middle of the three buttons in the top.

    Right hand corner of this window that will give you a bit more space on screen to write your code if you do that for all your modules when you want to switch between them you need to double click to.

    Switch between them so you can see the little title bar at the top of the window here shows you what your module you're currently looking at double clicking will switch between the.

    Different modules closing the modules down then is a case of clicking the bottom of the lower of the two crosses in the top right hand corner the screen now will close down the individual.

    Module windows rather than the entire VBA editor you can also choose to remove a module or delete it now you knew that by right-clicking on the module choose the remove option and.

    Then be careful about which button you click on the message which appears the temptation here is always to click yes when if you see one of these sorts of messages from Microsoft but on the.

    Button you actually want to click here is no you don't want to export the module before you remove it unless you actually do want to do that we don't want to export our module so if we click.

    No that will delete the module one by one we are exporting it another useful thing to be able to do with a module is to rename it to describe what's going to be contained.

    Within it so if I want to do that something to create another new module first so I'm going to right click in my project Explorer and choose insert module and then I need to rename it to.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continuetomake videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=KHO5NIcZAc4
Previous Post Next Post