How to Create a Shape Outline Button in Excel
In this article
Creating a shape outline button in Excel lets you build interactive, visually distinct triggers for macros or navigation—without using the default Form Controls. This approach uses a standard shape (like a rectangle) formatted to look like a button, then assigns a macro or action to it. You only need Excel installed (any modern version: 2016, 2019, 2021, Microsoft 365) and basic familiarity with the ribbon interface.
What You'll Need
- Microsoft Excel (2016 or later; works on Windows, Mac, and web versions)
- A worksheet where you want the button to appear
- Optionally, a macro to assign to the button (if you want it to run code)
Step-by-Step
- Open your Excel workbook and navigate to the worksheet where you want the button.
- Go to the Insert tab on the ribbon at the top of the window.
- Click Shapes in the Illustrations group—this opens a dropdown menu of geometric shapes.
- Select a rectangle shape (under the Rectangles section). The cursor changes to a plus sign; click and drag on the worksheet to draw the button to your desired size. Hold Shift while dragging to keep it perfectly square or maintain aspect ratio if desired.
- Format the shape as a button:
- Right-click the shape and choose Format Shape (or click the Format tab that appears after selecting the shape).
- Under Fill, select Solid fill and pick a color like light gray, blue, or white—avoid dark colors for readability.
- Under Line (or Outline), choose a solid line color (e.g., dark gray or black), set width to 1.5–2.25 pt for a crisp border, and ensure No fill is *not* selected for the fill.
- Optionally, under Effects > Shadow, apply a subtle Outer or Perspective shadow to give it a raised, clickable appearance.
- Add text to the button:
- Click once on the shape to select it, then click again to place the cursor inside—type your label (e.g., "Submit", "Clear Form", "Run Report").
- With the text still selected, use the Home tab to center-align it, increase font size (e.g., 10–12 pt), and choose a contrasting color (e.g., dark blue or black on a light background).
- Assign a macro (optional but common):
- Right-click the shape and select Assign Macro.
- In the dialog box, choose an existing macro from the list (if you’ve already created one in VBA), or click New to open the VBA editor and write a simple macro (e.g.,
Sub SubmitButton_Click()). - Click OK to confirm. If you created a new macro, Excel opens the Visual Basic editor—add your code between the
SubandEnd Sublines, then close it.
- Test the button:
- Click outside the shape to deselect it, then click the button directly—ensure it responds as expected (e.g., runs the macro or triggers an action).
- If no macro is assigned, the button remains static but still functions visually as a label.
Common Mistakes
- Over-formatting the shape—too many gradients, 3D effects, or bright colors can make the button look cluttered or hard to read. Stick to clean, subtle styling.
- Forgetting to assign the macro—drawing the shape isn’t enough; if you need it to run code, you must manually assign a macro via right-click > Assign Macro.
- Misaligned text—text may appear off-center if the shape isn’t sized evenly or if the text box isn’t centered. Use the Home tab’s alignment buttons to fix this.
- Placing the button in a filtered or protected range—if your sheet is protected, the button may not work unless you enable "Edit Objects" in Review > Protect Sheet options.
Tips
- Group shapes for consistency—if you create multiple buttons, draw the first, format it, then copy/paste it and change only the text. This ensures uniform size and style.
- Use AutoFit for dynamic text—right-click the shape > Size & Properties > Properties > choose "Move and size with cells" if you want the button to adjust when rows/columns resize.
- Hide the button when not needed—right-click and choose Hide (or set Fill > No Fill and Line > No Line) to temporarily remove it without deleting.
- Use keyboard shortcuts for speed—press Alt + N + S to open the Shapes menu directly; then use arrow keys to position the shape precisely.
Troubleshooting
If your shape outline button isn’t working as expected, follow these checks:
- Button doesn’t respond to clicks
- Ensure the sheet isn’t protected. Go to Review > Unprotect Sheet (enter password if set).
- Verify a macro is assigned: right-click the shape > Assign Macro > confirm a macro appears and is selected.
- Check if the macro itself has errors—open the VBA editor (Alt + F11), then run the macro directly from the editor to test.
- Text or formatting disappears after editing
- Click the shape once to select it (not edit), then use Format Shape to reapply fill/line settings.
- Ensure you’re not accidentally clicking off the shape when editing text—always finish editing by clicking outside the text box, not on the shape itself.
- Button moves unexpectedly
- Right-click the shape > Size & Properties > Properties > choose "Don’t move or size with cells" if you want it fixed in place.
- Lock the shape: Format Shape > Size & Properties > Properties > uncheck "Lock anchor" (if available) or ensure Protect Sheet doesn’t restrict movement.
- Shape appears invisible or unformatted
- Check if Fill is set to "No fill"—go to Format Shape > Fill and select a solid color.
- Verify the line color isn’t set to "No line" under Line > Line Color.
- Zoom in (Ctrl + Scroll) to confirm the shape is there; sometimes it’s just too small or off-screen.