Double click Module1 in the module and the code of the macro appears in the Code window. The code of MyName macro that you have recorded is stored in Module1 in the current workbook. This list is displayed as a tree diagram, which you can expand or collapse. In the VB Editor, the Project window displays a list of all open workbooks, worksheets, and add-ins.
Or you can also click the Stop Recording button on the status bar. Choose Developer ➪ Code ➪ Stop Recording.
This example explains to you how to record a very simple macro that will insert your name in the active cell. Learn Excel VBA Programming & Macros (Free Tutorial – Step by Step).Function procedures are created manually. You can’t create a Function procedure by using the macro recorder. Note: When you record your actions in Excel using the macro recorder, a new Sub procedure is created. This button is displayed in place of Start Recording button while you have started recording your macro. Or you can click the Stop Recording button on the status bar. When you finish recording the macro, choose Developer ➪ Code ➪ Stop Recording. When you begin recording your actions in Excel, click OK your actions within Excel will be translated to VBA code. Description: You can put a brief description of your macro.You have three choices: the current workbook ( This workbook), your Personal Macro Workbook, or a New workbook. Store Macro In: This is the option you can select to choose a location for your macro.For example, if you assign Ctrl+S to a macro, you can’t use this key combination to save your workbook when this macro is available. For example, pressing Shift while you enter the letter M makes the shortcut key combination Ctrl+Shift+M for your macro.Ĭaution: The shortcut keys you assign to macro take precedence over built-in shortcut keys for another command. You can also press Shift when you enter a letter. The key combination always uses the Ctrl key.
Shortcut Key: You can mention a key combination that will execute your macro.Excel displays generic names, such as Macro1, Macro2, and so on. Macro Name: You will enter a unique name for your macro.The Record Macro dialog box has several options:
Record the Macro icon on the left of the status bar.