Some useful macros

Robert de Levie · Cambridge University Press eBooks · 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.

Read the paper · More papers on PaperTik