CH 5 - Using Macros in Spreadsheet_Final
CH 5 - Using Macros in Spreadsheet_Final
1. What is a Macro? List any two real life situations where they can be used.
ANS: A macro is a single instruction that executes a set of instructions. These set of
instructions can be a sequence of commands that can be used for any number of
times. Two real life situations where they can be used are:
1. Data Entry in Spreadsheets: If you regularly enter the same type of data into
a spreadsheet (like sales records or class result), you can create a macro to
automate the entry process. For example, a macro can fill in predefined fields,
format cells, or calculate totals, saving time and reducing errors.
2. Automating Repetitive Tasks in Word Documents: In professions like legal or
academic writing, macros can automate the formatting of documents. For
instance, a macro can automatically apply specific styles to headings, create a
table of contents.
2. List the actions that are not recorded by a macro.
ANS: The Macro records all the keyboard and mouse actions but the following
actions are not recorded.
3. Window Switching: Switching between windows does not get recorded in the
macro.
5. Selection Methods: Selections are recorded when made using the keyboard
(e.g., arrow keys) but not when using the mouse.
My Macros:
In summary, while My Macros is a personal storage area for your macros, the
Macros Library encompasses a broader range of macros that can be shared and
accessed across different users and documents. This structure allows for both
individual customization and collaborative use of macros in LibreOffice.
5. List the rules that should be kept in mind while naming a macro.
1. Start with a Letter: Macro names should begin with a letter (A-Z or a-z), not a
number or special character.
2. Use Alphanumeric Characters: You can use letters (A-Z, a-z), numbers (0-9),
and underscores (_) in the name. Special characters (like @, #, $, etc.) and
spaces are not allowed.
3. Case Sensitivity: Macro names are case-sensitive, meaning "MyMacro" and
"mymacro" are considered different. Consistency in case usage is
recommended.
4. Limit Length: While there’s typically no strict limit, keeping names reasonably
short (but descriptive) is advisable for ease of use and readability.
5. No Leading Underscores: Some conventions suggest avoiding names that
begin with an underscore, as these may be reserved for system or internal
macros.
6. Use Unique Names: Ensure that each macro has a unique name within the
same library to avoid conflicts or confusion.
Example
Imagine you often need to format a report by applying specific fonts, colors, and
borders. Instead of doing this manually every time, you could create a macro
that applies all these formats with a single command. When executed, the macro
acts like a function, carrying out all these formatting steps automatically.