Published online by Cambridge University Press: 05 June 2012
What is a macro?
A spreadsheet macro is a computer program that can be called from inside a spreadsheet. The simplest macros merely allow the user to record a sequence of spreadsheet operations, which the computer then memorizes, and can repeat upon demand. All modern spreadsheets have facilities for recording and using macros to repeat a given series of instructions. While these can be quite useful for routine, repetitive computational tasks, their benefit in the present context is small, although we may occasionally use them to find out how Excel encodes visually entered information.
The major focus of this chapter will be on macros that extend the already considerable power of the spreadsheet, by incorporating external program instructions. Starting with Excel 5, the macro language (i.e., the computer language used to encode the macro) of Excel is VBA, which is sufficiently flexible and powerful to allow the spreadsheet user to introduce additional mathematical operations of his or her own choice, operations that are not already part of the usual spreadsheet repertoire. Earlier versions of Excel used a less transparent and certainly much less powerful macro language, called XLM, which will not be discussed here.
The letters VBA stand for Visual BASIC for Applications, an extension of BASIC, which itself is an acronym for Beginners' All-purpose Symbolic Instruction Code.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.