We cannot always record macros because they have a limited scope. It can’t be saved as a normal Excel file. We can only save the files with macros as Excel Macro-Enabled Template (file type).
#HOW TO WRITE A MACRO IN EXCEL 2007 HOW TO#
Method 3 – How to Save a File with Macro?
Now just click the button, and the macro will work. Then click on OK.Īnd drag the mouse to outline/create a button, rename it to “Data”. Once you click on the Command Button, you can then assign the macro as shown below. Then from Active X Controls, select the Command Button. Go to the Developer tab and click on the Insert tab. If you want to paste the data in sheet 2, just go to sheet 2 and press Ctrl+V or view macros. Click it to see the Macro window where you can select “Macro11” and click Run. The macros “Macro11” is stored on the Macros button. Now go to Macros and click on Stop Recording. Click on OK, and the macro will start recording. We will then store the macro in “This Workbook”.
Then we will assign a shortcut key to run the macro I assign CTRL+V. Ensure there should be no space and special characters in it. In our example, we will create/record a table of companies and their sales.Ĭlick on Record Macros, and you will see the below window pop up. Now we will name the macro as Macro11. Now, click on the Macros tab, and you will find the Record Macro option.Ĭlick on it to record whatever you want to, be it writing something or copying and pasting something. To begin, click the View button on the tab, then move to the right-hand side, and you will see the “Macros” tab as shown below. We will record the name of companies and their sales. Let’s take the example of recording a Macro. Once the Macro is recorded, we can just run it, and our work will be done. We can record a task that we use on a daily basis or which is repetitive. We can record a macro and use it any number of times. Method 2 – Creating Macros using Record Button You will see the Developer tab on the ribbon.