10 - Some useful macros
Published online by Cambridge University Press: 05 June 2012
Summary
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.
- Type
- Chapter
- Information
- How to Use Excel® in Analytical ChemistryAnd in General Scientific Data Analysis, pp. 375 - 483Publisher: Cambridge University PressPrint publication year: 2001