
The FormulaR1C1 part is a property of the Range object, it will be discussed later. This single statement creates the name you typed while recording the macro and it will be inserted into the active cell. If you ignore the comments, you’ll see that this procedure has only one VBA statement: These comment lines (which begin with an apostrophe) aren’t really necessary, and deleting them will not affect the performance of the macro. These comments are the information that you have provided in the Record Macro dialog box. Notice that Excel inserted some comments at the top of the procedure.
VIEW MACRO SHORTCUT KEYS CODE
The statements in the macro code tell Excel what to do when this macro is executed. The macro recorded is a Subprocedure and it is named MyName. The macro code should look something like this (in place of my name, you will see your name): Sub MyName() VB Editor is showing code of MyName macro created by Macro Recorder The following figure shows the recorded macro displayed in the Code window.

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.

Enter a new name for the macro, to replace Excel provided default Macro1 name.Choose Developer ➪ Code ➪ Record Macro.In such a case, when you will run the macro, it will always format that particular cell (the cell that is recorded), and it would not be a general-purpose macro. This step is important because if you select a cell after you have turned on the macro recorder, the cell will be recorded into the macro. Note: Select the cell that you want to format before you start recording your macro. To create this macro, start with a new workbook and follow these steps:
VIEW MACRO SHORTCUT KEYS HOW TO
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.

Excel displays generic names, such as Macro1, Macro2, and so on.
