The code stored in this folder is normally related to the items in the userform.ĭo you have any question regarding edit your macro? Ask Jason Khoo. Userform folder is the location where we design a dialog box which we could interact with the users. Whatever the code we write will be in the background to the excel file with which it is linked, and once we run the code, every process will happen in the background and what we see is the output in the excel file. Examples of events are opening the workbook, activating the worksheets, selecting the cells in a worksheet, double click with the left mouse button, etc.Ĭ. VBA Editor is a place where we write VBA code and create macros. Excel Objects folder usually store codes that are triggered by an event in the workbook or worksheet. You can also stored codes in the Microsoft® Excel Objects folder and the userform folder.ī. This is the place where you will edit your macroĪ. Double Click on Macro1 and the window on the right would pop up with the code to our recorded macro. Click on the Modules folder and you will see another folder called Macro1.Ĭ. You should see 2 folders, namely, Microsoft Excel Objects and Modules. Move your mouse cursor to the project explorer and over the “+” sign on the left of project called “VBAProject(Personal.xls)”.ī. Selecting one of the worksheets will display the properties for that worksheet.Ī. Book1) by click on the left mouse button over the “+” sign, we will see a list worksheets (e.g. If we select a worksheet found within a workbook (e.g. The properties window – will show the properties of the item within workbook or addin. In the diagram, we have an addin called PDFMaker.xla, a workbook called “Book1” and our personal workbook called “Personal.xls”.ī. Project Explorer – contains the workbooks (including addins and personal macro workbook) that are opened in Microsoft Excel. I recommend that you set up the visual basic editor to have the following views:Ī. To open the VBE, go to Menu -> Tools -> Macro -> Visual Basic EditorĢ. An object could mean a worksheet, the entire workbook,Ī userform or a folder called module where the macro codes are storedġ. This page will orientate you to the key elements you need to know about visual basic editor before your create or edit your macro.Having the right view will help you find out quickly where you have stored your codes, access the code directly, and also to find out the property of each object. It is also the place for you to create and manage macros.
These file types all support macros (VBA).To edit your macro, you have to go to the Visual Basic Editor (VBE). You will need to save your workbook as a macro-enabled file type if you want to use this code the next time you open the workbook. Select your code from the Macro window.Īlternatively, to open the Macro window you can use the Alt + F8 shortcut.Press the Macros button from the Code section.
In the Project Explorer, find the workbook you want to use the VBA code in and right click on it.Ī new item will appear in the project explorer called Module1 and the previously grey space will contain a white section.If you don’t see the project explorer, go to View > Project Explorer or press Ctrl + R. This will list all your open workbooks and VBE objects associated with them. The language file for VBA editor interface is stored in the following folder with different subfolders: C:\Program Files\Common Files\microsoft shared\VBA\VBA7.1 (you may need to search for VBEUIINTL. On the left hand side of the VBE you should see the Project Explorer side bar. Step 3: Insert a module into the current workbook. Press the Visual Basic button in the code section.Īlternatively, you can open the VBE with the Alt + F11 shortcut.Now you should see the Developer tab in your Excel ribbon and you can open the visual basic editor (VBE) from the ribbon. Step 1: Enable the Developer tab in the Ribbon.īy default the Developer tab is hidden and you will need to enable it to use in the ribbon.
If you’ve never used VBA and don’t know where to put the code and how to run it then follow this step by step guide to using the VBA code you found online. So you needed to do something in Excel and after a bit of searching online, the solution you found involves some VBA code (visual basic for applications).