
The following piece of code does exactly this: One of the most basic things needed for automation is reading a cell’s contents. This will open the LibreOffice Macro Editor as a separate window. After that, if you want to create a macro specific to your spreadsheet (as usually is the case), expand your spreadsheet file on left and select Standard and click New.

To create a macro, just open the spreadsheet in LibreOffice and go to Tools->Macros->Organize Macros->LibreOffice Basic menu. Whilst macros can be created in Writer and Draw too, in this specific tutorial, we will restrict ourselves to spreadsheets (Calc). Recipe 0: How to create a LibreOffice macro

The best thing about macros is that they are written in a very easy language called Basic.Īs it’s very name suggests, Basic is a lenient programming language actually designed with ease of use in mind. Macros are a great way to automate tasks in Spreadsheet applications, be it the good old Microsoft Excel or the equally efficient FOSS alternative, LibreOffice Calc.
