Page 235 - TP_IT_V1.0_C10_flipbpookl
P. 235
Access the Code Window of a Macro
Whenever a macro is created the code generated equivalent to the instructions given in a recorded macro are
stored internally in LibreOffice Calc in a programming language called BASIC. It is also possible to view and thus edit
the code of a macro, if you have knowledge of BASIC. You can view the code generated for the macros by following
the given step:
Step 1: Select the Tools Macros option from the Menu bar.
Step 2: Select the Organize Macros Edit Macros option from the submenu.
This will open a code window as shown below:
You will see that the code begins with sub followed by a macro name and ends with End Sub.
Using a Macro as a Function
In LibreOffice Calc, macros can be used to create user defined functions. Functions created using macros are not case
sensitive. The steps to create a simple macro function are as follows:
Step 1: Create a new spreadsheet.
Step 2: Select the Tools Macros option from the Menu bar.
Step 3: Select the Organize Macros Edit Macros option from the submenu.
The Macro code window opens.
Step 4: Create an empty line after Sub main and End Sub. Write the given code:
Function Displaycontent()
Displaycontent()=”Macros are interesting”
End Function
Electronic Spreadsheet (Advanced) using LibreOffice Calc 233

