From the course: Excel: Learning VBA

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Create, export, and delete code modules

Create, export, and delete code modules - Microsoft Excel Tutorial

From the course: Excel: Learning VBA

Create, export, and delete code modules

- [Instructor] Code modules store the VBA instructions you write to automate Excel. In this movie, I will show you how to work with those modules in your macro-enabled workbooks. My sample file is 01_05_Modules, and you can find it in the Chapter 1 folder of the Exercise Files collection. This workbook has a single worksheet with some data in it, but I'm actually more interested in the Visual Basic Editor, so I'll press Alt + F11 to move there. In the Visual Basic Editor, you'll see that over on the side I have the Project window or Project Explorer and I just have objects for Sheet1 and this workbook. I'd like to create a code module that I can use anywhere within this workbook. To do that, I will go to the Insert menu and then click Module, and that displays a blank code module that I can use to create my VBA routine. So, I'll just type a quick one here, I'll just call it Sub HelloMessage and then open and close…

Contents