7. Macros


A macro is a way to automate a task or procedure which you perform on a regular basis.

A macro is a series of instructions and/or actions that can be recorded and then set to run whenever you need to perform the task in the future


Examples of macro usemacro

- Producing a graph from a table of data

- Importing data from another program e.g. prices from a spreadsheet into a flyer

- Exporting data to another program

- Sorting data in a table

- Saving the contents of a worksheet as an archive file and then clearing the worksheet ready for the next day/week

- Printing a workbook / invoice


Features of macros

- Keystrokes or mouse clicks can be recorded to make the macro

- The actions are saved as Visual Basic code which can be edited by hand.

- Shortcuts keys can be allocated to macros, e.g. cont+C to copy, Cont+v to paste.

- Macros can be assigned to a button. When the button is pressed, the macro will run.

- Macros can be saved for future use.


Advantages of macros Problems with macros
A large number of tasks or actions can be recorded in a single macro A mistake made whilst recording the macro will be repeated every time the macro is run
A single click of a button or shortcut key can be used to see the macro running If something needs to be changed in the macro, the whole macro must be re-recorded
Macros easily automate repetitive processes If there are a large number of macros, the wrong macro might be chosen by mistake
Macros can help to ensure more accurate results than doing the task manually Macros can be used to spread computer viruses
  Security settings on computers, put in place to reduce the risk of macro viruses, might prevent the macro running
  The macro code can be difficult to understand for inexperienced users
  Macros can 'crash' the software or need 'debugging'


Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Macros