Creating shortcuts for Excel macros
Excel macros are programming code written in Visual Basic for Applications (VBA). This is a programming language that can automate repetitive tasks in Excel. I could devote a whole book to exploring the concept of macros, but I only have a small amount of space available. Allow me to share a technique that uses Excel’s Macro Recorder to change the cell color of one or more cells to yellow, which we’ll then tie to a Quick Access Toolbar icon. Let’s begin:
- Select cell A1 of a blank worksheet.
- Choose View | Macros | Record Macro….
- Assign a name, such as
YellowHighlight
, in the Macro Name field of the Record Macro dialog box, as shown in Figure 3.13:
Figure 3.13 – Macro Recorder
Nuance
You cannot use spaces or punctuation when naming Excel macros. The first character of a macro name must be a letter or underscore. You can use numbers in the second position and beyond....