What is macro ? How are they useful ?
A macro is a saved sequence of commands or keystrokes that are stored for later use
Marco are very useful for situation where set of actions are to be repeated with new set(s) of data every time
Advantages of Macros ?
1. Automates repetitive and routine tasks
2. Reduce the possibility of human error
3. Reduce the amount of time spent in basic, repetitive tasks
4. Makes complex computations easier to perform by storing them in a macro. The macro can be run many times as per need to perform the same complex task
How are macros internally saved ?
When we record macro, Calc internally create some programming code and store inside Sub and End sub clauses. Every time you run a macro, Calc simply runs this code.
Create a macro as a function which returns the cube of passed value
Function cube(x)
cube=x*x*x
End Function