We sometimes lack standard capabilities at work Excel and you have to strain your brains to write your own function or find a ready-made macro to solve this problem. This begs the question: What is a macro, how to write and where to insert it?
Macro
How to write macros is a separate big topic, on which hundreds of books have been written and there are many sites, so we will not consider it in this article. For those who are interested in this topic in more detail, there is on our website Lessons VBA , where you can learn more about macros.
Let's, after all, analyze where the macros need to be inserted so that they work in Excel .
Suppose we have ready macro to merge cells together with text (recall that by default Excel leaves only the text of the uppermost left cell when combining cells). Now how do we insert the VBA code of our function or procedure?
To add the macro code, you need to open the Visual Basic editor (Alt+F11), right-click on Microsoft Excel Objects, add the VBA module by selecting Insert - Module:
Now, copy the code of our macro there:
Click save and return to Excel.
In order to execute a macro, you need to highlight the necessary cells and select the name of our macro in the menu View - Macros
Press the button Perform
It's not that difficult...