
Moreover, you can add macro to Quick Access Toolbar and run it through QAT by the steps below. Run Macro through Quick Access Toolbar (QAT) To run VBA in the “Microsoft Visual Basic for Applications” window, you can just press “F5” key button or click the “Run” icon in the toolbar. Then, in the new module, you can put your code.From the drop down list, select “Module”.In the first place, click “Insert” button in toolbar.To begin with, double click on a project to open its window.īesides, you can add code to a module by the following steps.Put Code into Existing ProjectĪs you can see, under expanded “Microsoft Excel Objects” folder, you can see the existing projects, including the projects for each worksheet and the one for the current workbook called “ThisWorkbook”. Directly press “Alt + F11” key shortcuts to bring up “Microsoft Visual Basic for Applications” window.Īfter entering Excel VBA editor, you need to add your code into either a project or a module.On “Developer” tab, click the “Visual Basic” button in “Code” group.Lastly, click “OK” to save the changes.Įxcel VBA editor is the place where you put the code.Next, in the new window, select “Disable all macros except digitally signed macros” or “Enable all macros” option to your liking.Then, click “Macro Security” button in “Code” group.At first, in Excel main window, switch to “Developer” ribbon.Since Excel comes with macro auto disabled in security settings, you need to first change the settings by following the steps below:

Finally, click “OK” to enable the modifications.Next, in the right side, find and check the “Developer” option.In the popup “Excel Options” window, turn to “Customize Ribbon” tab.Then, go to “File” menu and click “Options”.

Now, thereinafter, we will use MS Excel 2010 for an instance to show the detailed steps, including how to enable macro, trigger VBA editor and several means to run macro, etc. If you intend to write some VBA codes to achieve some of your requirements, you have to firstly figure out how to run VBA code in your Excel. Now, in this article, we will teach you to run VBA code in Excel step by step.

It can assist you to accomplish a lot of tasks not supported by the native features in Excel. VBA is an excellent tool in Microsoft Office suite, including MS Excel application.
