How to Add Default Border in Excel

How-to basics · Updated November 25, 2026

Adding a default border in Excel means setting a specific border style that automatically applies to every new worksheet you create. This saves time if you frequently format tables or reports with the same outline. You can achieve this by modifying the default workbook template (Book.xltx) or by using a quick keyboard shortcut for the current sheet. The simplest method is to use the Ctrl+Shift+& shortcut to apply a thin border to selected cells, but for a true default that applies to all new files, you need to create a custom template. This guide covers both approaches.

What You’ll Need

  • Microsoft Excel (2016, 2019, 2021, or Microsoft 365) on Windows. Mac steps are noted where different.
  • Basic familiarity with selecting cells and using the Ribbon.
  • For the template method: access to your Excel startup folder (usually hidden, but you can navigate to it).

Step-by-Step

Method 1: Apply a Border to the Current Sheet (Quick)

  1. Select the cells you want to border. If you want the entire sheet, click the triangle at the top-left corner (where row numbers and column letters meet) to select all cells.
  2. Apply the border using the keyboard shortcut: press Ctrl+Shift+& on Windows. On Mac, press Command+Option+0 (zero). This applies a thin black border to the outer edge of the selected range.
  3. If you want a different border style (e.g., thick or dashed), go to Home > Font > Borders (the small arrow next to the border icon) and choose More Borders to customize.

Method 2: Set a Default Border for All New Workbooks (Template Method)

  1. Open a new blank workbook in Excel.
  2. Select all cells by clicking the triangle at the top-left corner of the sheet (where row and column headers meet).
  3. Apply the border you want as default. For example, to add a thin border to every cell, go to Home > Font > Borders and choose All Borders. You can also use the shortcut Ctrl+Shift+& for a thin outline, but that only puts a border around the selection, not inside. For a full grid, use All Borders.
  4. Customize other default settings (optional): You can also set default font, number format, or page setup in this workbook. These will carry over to new files.
  5. Save the file as a template. Press F12 (or File > Save As). In the Save as type dropdown, choose Excel Template (*.xltx). Name it Book (the default name for new workbooks).
  6. Save it to the correct location. Excel normally shows the default template folder. If not, navigate to the Excel startup folder: C:\Users\[YourUsername]\AppData\Roaming\Microsoft\Excel\XLSTART. On Mac: /Users/[YourUsername]/Library/Group Containers/UBF8T346G9.Office/User Content/Startup.
  7. Close and restart Excel. When you open Excel and click Blank workbook, the border will be applied to every cell. To test, create a new workbook and check that the gridlines show borders.

Method 3: Use a Macro to Automatically Apply Borders

  1. If you want borders only on certain sheets or with specific conditions, a macro can help. Press Alt+F11 to open the VBA editor.
  2. Go to Insert > Module and paste the following code:
Sub AddDefaultBorder()
    ' Applies a thin border to all cells in the active sheet
    Dim ws As Worksheet
    Set ws = ActiveSheet
    ws.Cells.Borders.LineStyle = xlContinuous
    ws.Cells.Borders.Weight = xlThin
End Sub
  1. Close the editor and run the macro by pressing Alt+F8, selecting AddDefaultBorder, and clicking Run.
  2. To make it run automatically when a new workbook is created, you can place the macro in the Workbook_Open event, but that requires more advanced steps. For most users, the template method is simpler.

Common Mistakes

  • Using the wrong border type: The shortcut Ctrl+Shift+& applies an outline border only, not a grid. If you want every cell to have borders, use All Borders from the Ribbon.
  • Saving the template with the wrong extension: Ensure you select Excel Template (*.xltx), not a regular .xlsx file. Otherwise, Excel won’t use it as the default.
  • Placing the template in the wrong folder: If you save it to your Documents folder, Excel won’t find it. Use the exact startup folder path.
  • Forgetting to select all cells before applying borders: If you only select a range, only that range gets borders in the template.

Tips

  • Use the Format Painter: If you already have a nicely bordered range, select it, click Format Painter (Home > Clipboard), then click on a new range to copy the border style.
  • Create a custom border style: In the Format Cells dialog (Ctrl+1 > Border tab), you can create a unique line style and color. Use that in your template.
  • Combine with other defaults: While in the template, also set your preferred font, column widths, and print settings to save even more time.
  • Use the keyboard shortcut for quick toggling: Press Ctrl+Shift+_ (underscore) to remove borders from selected cells.
  • For Mac users: The shortcut for borders is Command+Option+0 (zero) for outline, and Command+Option+_ to remove.

Troubleshooting

  • Borders don’t appear on new workbooks: Check that you saved the template as Book.xltx in the correct XLSTART folder. Also, ensure you didn’t accidentally name it Book.xltx.xltx (double extension). Restart Excel completely.
  • Borders appear only on the first sheet: The template applies to all sheets in the new workbook, but if you only selected one sheet before saving, the others won’t have borders. Select all sheets by right-clicking a sheet tab and choosing Select All Sheets before applying borders.
  • The shortcut doesn’t work: Make sure you are pressing the ampersand (&) with the Shift key. On some keyboards, you may need to use the number row’s 7 key. If it still fails, use the Ribbon method.
  • Macro doesn’t run: Ensure macros are enabled (File > Options > Trust Center > Trust Center Settings > Macro Settings). Also, save the workbook as a macro-enabled file (.xlsm) if you want to keep the macro.

Frequently Asked Questions

Q: Can I set a default border only for a specific range, like A1:F10?
A: Yes. Instead of selecting all cells, select the range you want (e.g., A1:F10) before applying borders and saving the template. New workbooks will have borders only on that range.

Q: Will the default border affect existing workbooks?
A: No. The template only applies to new workbooks created after you save it. Existing files remain unchanged.

Q: How do I remove the default border later?
A: Delete the Book.xltx file from the XLSTART folder. If you want to keep the template but change it, open it, modify the borders, and save it again.

Q: Does this work in Excel for the web?
A: No. Excel for the web does not support custom templates. You can still apply borders manually using the toolbar, but there is no way to set a default.

Q: Can I use a different border style, like dashed lines?
A: Yes. In the Format Cells dialog (Ctrl+1), go to the Border tab, choose a line style (e.g., dashed), and apply it to the selection before saving the template.

Q: What if I only want borders on cells with data?
A: You can use conditional formatting. Select the range, go to Home > Conditional Formatting > New Rule, choose Use a formula, enter =A1<>"" (adjust to your range), and set a border format. This will dynamically border only non-empty cells.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.