13.2 Macro Storage, Shortcut Assignment, & Form Control Buttons
Key Takeaways
- Form Control Buttons (Developer > Insert > Button) provide dedicated on-sheet triggers and automatically launch the Assign Macro dialog upon placement.
- Graphic shapes, SVG icons, and images can be transformed into interactive macro triggers by right-clicking the object and selecting Assign Macro.
- The Quick Access Toolbar (QAT) can be customized via Excel Options to host macro triggers, allowing custom icons and clean hover ScreenTips.
- Macro shortcut keys and description strings can be modified post-recording by selecting Developer > Macros (Alt+F8) and clicking the Options button.
- Workbooks containing VBA macros cannot be saved as standard .xlsx files; saving requires the macro-enabled .xlsm format or binary .xlsb format to prevent code stripping.
12.2 Macro Storage, Shortcut Assignment, & Form Control Buttons
Recording an automated routine is only the first phase of enterprise spreadsheet automation. To ensure end users can trigger routines safely and efficiently, Excel provides multiple user-interface deployment mechanisms: dedicated on-sheet Form Control buttons, styled graphical shapes, and Quick Access Toolbar (QAT) shortcuts. Furthermore, spreadsheet authors must properly configure spatial object properties, manage shortcut keybindings, and enforce workbook security and file format compliance to prevent accidental macro deletion.
Form Control Buttons vs. ActiveX Controls
When inserting clickable triggers on a worksheet, Excel presents two distinct control categories under Developer > Controls > Insert:
- Form Controls: Native, lightweight worksheet objects designed specifically for Excel spreadsheets. Form Control buttons bind directly to existing macros without requiring custom event programming. They are stable, compatible across Mac and Windows versions of Excel, and represent the primary control type evaluated on the MO-211 exam.
- ActiveX Controls: Legacy Windows COM-based controls with extensive customizable properties and dedicated sheet-level event procedures (e.g.,
Private Sub CommandButton1_Click()). ActiveX controls are platform-dependent, disabled by default on macOS, and prone to security restrictions in modern enterprise environments.
Developer Tab ──► Controls Group ──► Insert ──► Form Controls: Button (Form Control)
Inserting and Configuring a Form Control Button
To place a Form Control button onto the worksheet canvas:
- Navigate to the Developer tab, locate the Controls group, and click Insert.
- Under the top group labeled Form Controls, click the Button (Form Control) icon (represented by a small rectangular button).
- Move the cursor over the worksheet; the pointer transforms into a precision crosshair (
+). - Click and drag diagonally across the sheet to draw the button's rectangular footprint.
- Tactical Tip: Holding the Alt key while dragging snaps the button boundaries precisely to the underlying worksheet cell gridlines, ensuring clean architectural alignment.
- Upon releasing the mouse button, Excel automatically displays the Assign Macro dialog box.
- Select the target macro from the list (e.g.,
ClearDataInputs) and click OK.
Editing Button Label Text
Newly drawn buttons display generic labels such as Button 1. To customize the label:
- Right-click the button and select Edit Text from the context menu (or hold
Ctrland click the button to select it, then click inside the text boundary). - Highlight and delete the default text, then enter a clear, action-oriented business command (e.g.,
Run Quarterly AuditorClear Filters). - Press
Esctwice to exit text editing mode and deselect the button.
Spatial Anchoring & Control Properties
Worksheets frequently undergo column resizing, row insertions, and filtering. If a button's spatial properties are misconfigured, sorting or filtering underlying rows can cause the button to compress into a distorted line or disappear entirely.
To configure button behavior, right-click the button, select Format Control..., and navigate to the Properties tab:
+-------------------------------------------------------------------+
| Format Control |
+-------------------------------------------------------------------+
| Margins | Size | Protection | Properties | Alt Text | |
+-------------------------------------------------------------------+
| Object positioning |
| ( ) Move and size with cells |
| (o) Move but don't size with cells |
| ( ) Don't move or size with cells |
| |
| [x] Print object |
| [ ] Locked |
+-------------------------------------------------------------------+
Object Positioning Options
| Positioning Option | Behavior During Column/Row Resizing | Behavior During Filtering/Row Insertion | Recommended Application |
|---|---|---|---|
| Move and size with cells | Stretches or shrinks proportionally when underlying columns or rows are resized | Hides or flattens completely if underlying rows are filtered out | Table-embedded data action buttons that correspond to specific rows. |
| Move but don't size with cells (Default) | Maintains constant width and height regardless of cell dimensions | Shifts position down or right when rows/columns above or left are inserted | Floating dashboard buttons placed adjacent to expanding data ranges. |
| Don't move or size with cells | Remains completely locked at absolute screen coordinates | Ignores all row/column insertions, deletions, and filtering | Fixed navigational bars or top-pinned administrative trigger panels. |
The "Print Object" Property
The Print object checkbox controls whether the Form Control button appears on physical printouts or exported PDF documents. In professional reporting, operational buttons (e.g., Print Form, Reset Sheet) should be accessible on-screen but hidden on deliverables. Unchecking Print object keeps the button fully interactive on screen while omitting it from printed pages.
Assigning Macros to Shapes, Icons, & Images
While Form Control buttons provide functional simplicity, they lack modern aesthetic styling options (such as rounded corners, custom gradients, SVG graphics, and typography styling). Excel allows authors to convert any graphical drawing object into an interactive macro trigger.
Graphical Assignment Workflow:
- Insert a visual asset via
Insert > Illustrations > Shapes(e.g., Rounded Rectangle),Icons, orPictures. - Format the graphic using Shape Format tools (e.g., corporate fill colors, subtle drop shadows, centered white bold typography).
- Right-click the graphic object and select Assign Macro... from the context menu.
- In the Assign Macro dialog, select the target procedure and click OK.
Once assigned, hovering the mouse cursor over the graphic changes the cursor from a standard arrow into a clickable hyperlink hand (👆), signaling to users that the object is an interactive trigger.
Quick Access Toolbar (QAT) Customization for Macros
For macros executed frequently across multiple worksheets or workbooks, adding a dedicated button to the Quick Access Toolbar (QAT) allows one-click execution without cluttering the worksheet canvas.
File ──► Options ──► Quick Access Toolbar ──► Choose commands from: [Macros]
│
▼
Select Macro ──► Click [Add >>]
│
▼
Click [Modify...] Button
│
▼
Select Icon & Custom Display Name
Step-by-Step QAT Integration:
- Click File > Options and select Quick Access Toolbar in the left navigation pane.
- In the Choose commands from dropdown list, switch from "Popular Commands" to Macros.
- Locate and select the desired macro in the left column (e.g.,
PERSONAL.XLSB!FormatActiveTableormodReports.RunAudit). - In the upper-right dropdown labeled Customize Quick Access Toolbar, choose the scope:
- For all documents (default): Makes the macro button visible permanently across all Excel sessions.
- For [CurrentWorkbook.xlsm]: Restricts button visibility exclusively to the active project workbook.
- Click the Add >> button to move the macro into the right-hand active toolbar list.
- With the macro highlighted in the right list, click the Modify... button below the pane.
- In the Modify Button dialog:
- Select a distinct graphic symbol from the icon library (e.g., calculator, document, checkmark, lightning bolt).
- In the Display name box, replace the technical procedure string with a clean user-facing title (e.g.,
Run Audit Script). This text defines the hover ScreenTip displayed when users mouse over the QAT button.
- Click OK twice to commit changes and return to the worksheet.
Managing Macro Options & Keybindings
If a macro was recorded without a shortcut key or requires an updated description, authors do not need to re-record the procedure. Keybindings can be managed via the Macros dialog:
- Open the Macro management console via
Developer > Code > Macrosor by pressing Alt+F8. - Select the target macro from the list.
- Click the Options... button on the right-hand rail.
- The Macro Options dialog box opens, allowing the author to:
- Assign, edit, or clear the
Ctrl+orCtrl+Shift+Shortcut key. - Update the Description metadata string.
- Assign, edit, or clear the
- Click OK to save modifications, then click Cancel to close the Macro dialog.
(Note: Renaming a macro identifier cannot be performed in the Macro Options dialog; procedure renaming requires editing the Sub declaration directly in the Visual Basic Editor.)
Storage Formats: Where a Recorded Macro Survives a Save
A macro persists only inside a macro-capable container. Recording into a .xlsx workbook and pressing Ctrl+S raises a modal warning that the VB project cannot be saved in a macro-free workbook; accepting it commits the file as .xlsx and permanently purges every module, UserForm, and recorded procedure. Press F12 to reopen Save As and choose Excel Macro-Enabled Workbook (.xlsm), Excel Binary Workbook (.xlsb), or Excel Macro-Enabled Template (.xltm) from the Save as type dropdown instead.
Section 1.2 compares every workbook format and its macro support in full, and Section 2.3 covers the Trust Center macro settings and Trusted Locations that decide whether a saved macro is then permitted to execute. What matters for macro storage is the pairing below.
| Where the macro lives | Available from | Travels with the file? |
|---|---|---|
A standard module in ThisWorkbook | Only that workbook | Yes — if saved as .xlsm, .xlsb, or .xltm |
Personal Macro Workbook (PERSONAL.XLSB) | Every workbook on that machine | No — it stays on the local machine |
| New Workbook (Record Macro dropdown) | The new workbook Excel creates | Yes, once that workbook is saved macro-enabled |
What happens if a user saves an Excel workbook containing recorded macros as a standard Excel Workbook (.xlsx) and clicks 'Yes' when prompted by the warning dialog?
Which object positioning property in the Format Control dialog ensures that a Form Control button does not shift its screen location or alter its dimensions when rows above it are inserted or underlying columns are resized?
When adding a macro to the Quick Access Toolbar via Excel Options, which command allows the user to replace the default generic icon and modify the ScreenTip hover text?