Nowadays, writing codes or creating codes have become super easy. With the advance of software technology, you no more need to worry about syntax, compiling and running, atleast for some languages. VBA is one such language, which anyone can learn quite easily, with a little patience and a bit of technical know-how!
Macro is nothing but a code, that you create once, and use for all other repetitive tasks. Do not get scared. Creating code in Macro is more easy than you can think of. All you need to do is use the Macro Recorder, turn it On and perform the operations once, and stop the recorder to complete the recording process. Once, the recording is succesful, your code is also generated and is ready to be implemented.
Now, before proceeding further, let me talk a little more, if you are not bored reading. While you are setting up the Macro recorder, you will find that Excel is prompting you to enter a shortcut, which is Ctrl+ Key, where the Key implies any key you want. You can change the Ctrl to Ctrl+Shift+Key by tapping Shift and the key. Well, we recommend you to not set any commonly used alphabets. For example, if you set Ctrl+C, which is the default shortcut for Copy function, then the copy function will be overwritten and replaced by the one you have set. So, for that particular worksheet, you won’t be able to use Ctrl+C for copying purpose.
Here, one important thing to tell you is that, no matter what shortcut you set for your Macro, it will never affect your PC or any other software, or even any other file. This is because, in order to avoid confusion and preserve the integrity of your OS, Microsoft does not allow Office users, to save a macro code in a standard Office document with a standard format. You have to save it in a file with a special extension.
So, finally here I am showing you to use the Macro recorder.
Steps To Use The Macro Recorder In MS Excel For VBA
First, you have to turn on the Developer Tab in MS Excel.
Next, tap on the Developer tab in the Ribbon. Under the Developer tab, there is an option called Use Relative References. Click on it. Then click on Record Macro .
Now, the Record Macro window opens. Select a shortcut key for you. For example, I have selected Ctrl+q, you can select Ctrl+Shift+q or anything you want.
Now, type the text or table, that you want to repeat. Finally, hit Ctrl+Enter for the final cell. You can simply tap Enter, but that would take you to the next cell, which may not be a desirable step for you. Ctrl+Enter doesn’t navigate you to any other cell, other than the one you are working in. Next, click on the Stop Recording button. Many people commit this mistake. Please do not forget to hit on the Stop Recording button.
It’s done! Now, check how it works. Suppose, you want to keep track of how much time you are spending on your blog everyday. You have created a macro code as shown. Now you want to insert the table repeatedly. Go to the Developer tab, click on Macro.
Select the Macro you need and hit RUN.
And you are done. Press the shortcut key combination, every time you want to repeat.