To add an outline border in Excel for Microsoft 365 on Windows, select the cell or range and press Ctrl+Shift+&. For other border styles, press Alt, then H, then B to open the Borders menu, and choose the option you need. These shortcuts format cell edges; they do not change worksheet gridlines.
What You’ll Need
- Excel for Microsoft 365 on a Windows computer for the keyboard sequences in the steps below. Some older desktop versions use the same commands, although ribbon KeyTips can differ.
- A workbook with the cells or range you want to format. Save it first if you are making important layout changes.
- If you are using a Mac or Excel for the web, you can still add borders from the ribbon; the Windows keyboard access sequence may not work the same way there.
Step-by-Step
- Select the target cells. Click a single cell for a border around that cell, or drag across a range to format several cells. You can also click the first cell, hold Shift, and click the last cell in the range. To select nonadjacent cells, hold Ctrl while selecting each one. Check the highlighted range before applying a border, because Excel applies the command to the current selection.
- Apply a quick outline border, if that is what you need. With the cells selected, press Ctrl+Shift+&. Excel adds an outline border around the selected cell or range using the current default border formatting. This is a useful one-step shortcut when you want a clear edge around a block of data and do not need to add lines between its cells.
- Open the full Borders menu for a different style. On an English-language Windows keyboard, press and release Alt, then press H for the Home tab, then B for the Borders menu. Press the keys one after another rather than holding them all down together. The menu displays the available border commands.
- Choose the border type. Use the arrow keys to move through the menu and press Enter to apply the highlighted option. Depending on the Excel version and the menu, you can also press the letter shown in a KeyTip beside an option, or click the option with the mouse after opening the menu. Common choices include Bottom Border, Top Border, Left Border, Right Border, All Borders, Outside Borders, and No Border. If you are unsure which item is highlighted, read the option name before pressing Enter.
- Use All Borders when every cell needs its own edges. Select a table-like range and choose All Borders to draw lines around each cell, including the internal edges between neighboring cells. This is different from Outside Borders, which draws around the outside of the selected range without adding lines between its cells. Use the one that matches the structure you want to show.
- Add a single edge to distinguish a row or column. Select the relevant cells and choose the needed edge, such as Bottom Border under a heading row or Right Border beside a total column. For example, selecting A1:D1 and applying a bottom border puts a line beneath those four cells. The border is applied to the selected cells, not to the entire worksheet row unless you select the whole row.
- Check the result and adjust the selection if needed. Look at the worksheet at a comfortable zoom level. If the line appears in the wrong place, press Ctrl+Z once to undo the border, select the intended cells, and apply the command again. Undo works for normal border formatting, but do not assume it will reverse every change made by a macro or another process.
- Use the ribbon on Mac or Excel for the web. In Excel for Mac, select the cells and use Home > Borders to pick an edge or border style. The Windows Alt-based KeyTip sequence is not a reliable cross-platform shortcut, and Mac key combinations can depend on the keyboard layout. In Excel for the web, use Home > Borders if the Windows sequence is intercepted by the browser or does not open the menu. The ribbon is also a dependable option if you cannot remember a shortcut.
For a keyboard-only workflow on Windows, you can use the ribbon sequence and then navigate the open menu with the arrow keys. The exact KeyTip letters shown beside individual menu options may vary with the Excel build, language, or interface. Follow the letters actually displayed rather than memorizing a letter sequence from another computer. The general Alt, H, B route opens the border choices in English-language desktop Excel.
Common Mistakes
- Confusing an outline with a full grid of cell borders. Ctrl+Shift+& is the quick outline-border shortcut. It does not mean All Borders. If you need lines between each cell in a selection, open the Borders menu and choose All Borders.
- Selecting only one cell by accident. A border command affects the active selection. If only one cell is highlighted, Excel will not format the whole table. Confirm the selection outline covers the full intended range before using a shortcut.
- Holding the ribbon keys together. The Alt, H, B access sequence is pressed in stages: press Alt, release it, press H, then press B. Treating the sequence as one simultaneous chord can fail to activate the ribbon KeyTips.
- Expecting No Border to remove worksheet gridlines. No Border removes applied cell borders from the selection. Gridlines are a separate worksheet display feature, so they can remain visible even after you remove borders.
- Applying a border to the wrong edge. A bottom border on a heading row is not the same as an outside border around a table. Review the selected border option and the affected cells, especially when working with totals or multirow headings.
- Assuming all border options use the same line weight or color. A basic shortcut is convenient, but a complex report may need a specific line style or color. Use the Borders menu and its line-style or color controls when the default appearance is not suitable.
Tips
- Use the shortcut that matches the job. For a simple box around a selection, Ctrl+Shift+& is fast. For an internal grid, a single edge, or no border, use Alt, H, B and select the named command.
- Try the Format Cells dialog for more control. On Windows, select the cells and press Ctrl+1, then open the Border tab. You can choose a line style and color and click specific edges in the preview before confirming. This is helpful when a report needs more than the default thin line.
- Use borders to communicate structure. A bottom edge under headings or a stronger outside edge around a summary can make a sheet easier to scan. Avoid placing a heavy line around every cell if it makes dense data harder to read.
- Keep consistent formatting. Apply the same border style to equivalent sections, such as all subtotal rows. If a range is already formatted correctly, copying its formatting with Format Painter can be quicker than rebuilding each edge manually.
- Check print appearance separately. Cell borders are part of cell formatting and normally print. Gridlines have separate display and print settings. Use Print Preview to confirm that the borders have enough contrast and that the table fits the page as intended.
- Remember the removal shortcut. On Windows, Ctrl+Shift+_ removes the outline border from the selected cells. On many keyboards, the underscore is typed with Shift and the minus key. Because layouts differ, use the Borders menu and choose No Border if that key combination is awkward or does not work. No Border removes the applied borders from the selection, including internal borders.
Troubleshooting
Nothing happens after Alt, H, B. Make sure you are in the Excel desktop app on Windows, not in a browser or another program. Press Alt once and check whether KeyTips appear on the ribbon. Then press H and B separately. If the letters do not match your interface, use the visible KeyTips or open Home > Borders with the mouse. KeyTips can differ in localized versions of Excel.
The shortcut applies the border to just one cell. The selection probably contained only the active cell. Undo with Ctrl+Z, select the full range, and repeat the command. When selecting by keyboard, use the arrow keys with Shift to extend the selection, then verify the highlighted cells before applying the border.
You can see a line on screen but it does not print. First check whether it is an applied cell border or a worksheet gridline. Gridlines are not the same as borders and have separate print settings. If the line is a border, open Print Preview and inspect page scaling, print area, and whether the relevant cells are included. If it is a gridline, use the sheet’s page layout or print settings to control whether gridlines print.
The border color or thickness is not what you expected. A keyboard shortcut applies a preset border and does not provide the full styling controls. Select the range, open Home > Borders, and look for the line color and line style options, or press Ctrl+1 and use the Border tab. Choose the style and color before clicking the desired edges in the preview.
The shortcut behaves differently on a Mac or in a browser. Do not rely on Windows ribbon access keys in those environments. Use the Home tab’s Borders menu instead. In Excel for the web, browser shortcuts may take priority over Excel shortcuts; the ribbon provides a clear alternative. On a Mac, the available keyboard combination may also vary with the keyboard layout and Excel release.
No Border did not remove the faint lines from the sheet. Those are likely gridlines rather than applied borders. Removing cell borders will not hide gridlines. If you want a clean view, change the gridline display setting for the worksheet; if you want to remove only formatted edges, select the cells and choose No Border.
Frequently Asked Questions
What is the shortcut to add a border in Excel?
On Windows, select the cell or range and press Ctrl+Shift+& to add an outline border. For other choices, press Alt, H, B and select a border from the menu.
How do I add borders to every cell in a range?
Select the range, open the Borders menu with Alt, H, B on Windows, and choose All Borders. That adds both the outside edges and the lines between cells.
How do I add only a bottom border with the keyboard?
Select the target cells, press Alt, H, B, and choose Bottom Border from the menu. You can use the arrow keys and Enter, or the option’s displayed KeyTip where available.
Does Ctrl+Shift+& add borders to each cell separately?
No. It adds an outline around the selection. Choose All Borders when you also need internal lines between the selected cells.
How do I remove a border without deleting the cell contents?
Select the cells and choose No Border from the Borders menu. The command changes formatting, not the values or formulas in those cells. On Windows, Ctrl+Shift+_ removes the outline border, but No Border is the clearer option when removing all applied edges.
Do Excel borders and gridlines mean the same thing?
No. Borders are cell formatting that you add to selected cells and can style individually. Gridlines are worksheet guides that help show cell boundaries; their display and printing are controlled separately.
Related
- How to Delete an Excel File Safely on a Windows Computer
- How to Change Text to Dates in Excel
- How to Copy an Excel Spreadsheet Safely
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Add an Auto Reply to a Shared Mailbox in Outlook 365To add an automatic reply to a shared mailbox, open that mailbox in Outlook on the web and…
- Excel Script: Set Number Format in a RangeTo set a number format with an Excel Office Script, get the target range and call its setNumberFormat()…
- Consolidate Rows in Excel Based on CriteriaTo consolidate rows in Excel based on matching criteria, create a PivotTable: select the data, choose Insert >…
- Excel Shortcuts for Naming a Range and Managing NamesIn Excel for Microsoft 365 on Windows, press Ctrl+F3 to open Name Manager, then choose New to name…
- Google Sheets D&D Character Sheet: How to Build OneYes—Google Sheets can work as a D&D character sheet: use a template or make a spreadsheet with your…
- Excel Random Numbers Between a Range and ValueIn Excel for Microsoft 365, use =RANDBETWEEN(1,100) to generate a random whole number from 1 through 100, including…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.