Download Software development process
Transcript
LANGUAGES AND ENVIRONMENT Another window will open, which displays the code of the macro you have recorded, like this: You should be able to recognise the actions you took. For example, the first section records the macro’s name and shortcut key. Next comes the action of selecting cell AI, changing the font to18 point, making it bold, and so on. The macro is actually coded in a scripting language called Visual BASIC for Applications, or VBA for short. What use is a macro? • • • Keep course 2.xls open. Open course_copy.xls. Hold down Ctrl + Shift + K. The file course_copy.xls should be automatically formatted by the macro to be the same as course2.xls. If the user had several similar unformatted spreadsheets and wanted them all formatted in this way, he could save a great deal of time by using the macro. A macro is a time-saving program written in a scripting language which can be activated by a series of key strokes for repeated use. A macro cannot exist alone – it only works with an application program (in this case, Excel). In this example, we have seen a macro being used with a spreadsheet. Macros can be used with many other application packages. 32 SOFTWARE DEVELOPMENT (INT 2, COMPUTING) © Learning and Teaching Scotland 2009