


To view the code that was generated during the recording, open the Visual Basic editor by typing Alt+F11 and navigate to Module1 of the active workbook in the Project window. So try to be deliberate in what you do with the recorder running – it will make your code easier to understand later on. One warning: Excel records everything you do in the workbook. Next, perform some actions in the workbook. When the Record Macro Dialog box opens, you can give your macro a name, shortcut key, and description. To record a subroutine or macro, click the Record Macro icon in the lower left of the Excel window. I’ll focus on recording a subroutine with the macro recorder and editing it in the VBA editor in this post. Write the code from scratch in the VBA Editor.Record some actions with the Macro Recorder.There are two main ways to create a subroutine: They can even write to external files, open other applications and a lot more. Unlike UDF’s, they can change formatting of a workbook, delete cells/rows/columns/worksheets, and add data to any cell on a worksheet. What’s an Excel Subroutine?īasically, Excel VBA subroutines are collections of code that carry out specified actions on a worksheet. Now that we have User Defined Functions under our belts, let’s take a look at Excel VBA subroutines.
