Macros are to be scripted in VBA. However, you really don’t have to know VBA scripting to write a macro for your repeated tasks.
Microsoft Office provides you a way to record a macro, thus automatically generating the necessary VBA code to run those repeated actions. In Microsoft Office applications, such as Word and Excel, you can turn this on through the Developer menu/tab.
You will see a section with options to code, and you need to just choose “Record Macro,” give a name, and start doing your action. When you are done, just press the stop recording button. To see the auto generated VBA code, press “Macros,” open the Macro that you just recorded. It opens the Visual Basic for Applications Editor with the code for you.