In Excel for Microsoft 365 on Windows, press Alt, H, B in sequence to open the Home tab’s Borders menu, then choose the border option shown by its on-screen KeyTip. For a quick outline around a selection, press Ctrl+Shift+&; to remove that outline, press Ctrl+Shift+_ (the underscore key, usually Ctrl+Shift+-).
What the main border shortcuts do
There are two useful ways to work with borders from the keyboard. The first is the ribbon KeyTip sequence, which opens the full Borders menu. The second is a direct shortcut for applying or removing an outline border. They do different jobs, so choosing the right one avoids a common surprise: an outline shortcut does not automatically draw lines between every cell in a selected range.
- Alt, H, B: open the Borders menu through the Home tab. Press each key in turn, rather than holding all three down together. Then press the letter displayed beside the option you want.
- Ctrl+Shift+&: apply an outline border to the selected cell or range.
- Ctrl+Shift+_: remove the outline border from the selection. On many keyboards, type this as Ctrl+Shift+-.
The menu is the better choice when you need a particular edge, internal lines, or a thicker border. The direct shortcut is handy for quickly boxing a heading, total, or small block of cells. KeyTips are displayed on screen as you work; their letters can depend on the Excel language and ribbon version, so follow the letters visible on your own screen rather than relying on a memorized final key.
Using the Borders menu on Windows
To apply a border using the ribbon, select the target cell or range, press Alt, then H, then B. Excel opens the Borders dropdown. Read the KeyTips beside the available commands and press the one beside the border you need. You can also use the mouse: choose Home > Borders in the Font group, then select an item from the dropdown. The ribbon path is useful if the KeyTips are unfamiliar or have changed in a localized version of Excel.
Common choices in the menu include bottom, top, left, and right borders; outside borders; all borders; and options for heavier or double lines. The exact menu layout can vary slightly by Excel build or window size, but the command names describe which edges will be formatted. If you want to apply a single edge, select the relevant cell or cells first. If you want a frame around several cells as one block, select the entire range before choosing Outside Borders.
- Select the cell or range. Drag across cells, or click a cell and extend the selection with the keyboard.
- Open the Borders menu with Alt, H, B, or click Home > Borders.
- Choose the required command using the displayed KeyTip or by clicking it.
- Check the result at the edges of the selected cells. If it is not right, use the menu again to change or remove the border.
For example, to frame a monthly total in D12:F12, select D12:F12 and apply Outside Borders. To draw a divider beneath a column heading in A1:E1, select A1:E1 and choose Bottom Border. These selections matter: a border command formats the current selection, not necessarily the whole row or column represented by the values.
Outline borders versus all borders
An outline border puts a frame around the outside of the selected area. On a multi-cell selection, it does not add lines between the cells inside that frame. In contrast, All Borders adds borders around individual cells, including the internal boundaries. This distinction is especially important when formatting a table-like range: Ctrl+Shift+& is not a keyboard substitute for All Borders.
Suppose B2:D5 contains a four-row, three-column summary. Applying an outline gives the whole B2:D5 block an outer frame. Choosing All Borders gives every cell its own visible boundary, creating a grid. If you want both the perimeter and internal dividers, choose All Borders from the Borders menu. If you want only a clean frame around the block, choose Outside Borders or use the outline shortcut.
Cell borders are also different from worksheet gridlines. Gridlines are the faint guides Excel normally displays between cells; they are not cell formatting and may not print. Borders are explicit formatting and can print with the worksheet when print settings allow. Applying white fill, hiding gridlines, and adding borders are separate actions, so do not assume that changing one automatically changes the others.
Changing border color, weight, and style
The shortcut for an outline applies the default border formatting. To choose a color, line weight, or line style, use the Borders dropdown on Home. Its options let you select line color and style, and then apply the chosen format to an edge or range. In some layouts, you can choose a line setting first and then click the border command; in others, use the Format Cells dialog for more deliberate control.
For the dialog, select the cells and open Format Cells with Ctrl+1. Choose the Border tab, select a line style and color if needed, then click the preview edges to turn them on or off. The preview is useful for combinations such as a thick bottom edge with thin internal lines. Confirm with OK to apply the formatting. The dialog exposes more choices than the quick outline shortcut, although it takes more steps.
A practical format for a report might use a thick outside edge around a final total, a thin bottom border below column headings, and no internal lines in the data area. Use a consistent style to signal structure rather than adding heavy lines everywhere. Too many borders can make a worksheet harder to scan, especially when fills, bold type, and gridlines already provide visual cues.
Removing borders without changing other formatting
To remove an outline border from a selection, use Ctrl+Shift+_. This targets the outline, not every possible internal border. For complete removal, select the cells, open Home > Borders, and choose No Border. That command removes the cell borders in the selection while leaving values, formulas, font formatting, and fills intact.
Be careful with the eraser tool in the Borders menu: it is intended to remove borders by clicking or dragging over affected edges. It can be useful for fine adjustments, but selecting No Border is usually clearer when you want to reset a whole range. If the border seems to remain, check that the intended cells are selected and that the visible line is actually a cell border rather than a worksheet gridline, a shape, or conditional formatting.
Mac and Excel for the web
The Windows KeyTip sequence Alt, H, B is specific to the Windows ribbon and should not be assumed to work the same way on a Mac. In Excel for Mac, use Home > Borders and select the needed command from the dropdown. For a quick outline, the Mac shortcut is commonly Command+Option+0; keyboard layouts and Excel settings can affect shortcut behavior, so consult the menu or Excel’s shortcut list if it does not respond.
Excel for the web also provides border commands on the Home tab. Windows desktop key sequences may depend on the browser and keyboard configuration in the web app, so the ribbon menu is a reliable alternative. If a shortcut is intercepted by the browser or operating system, select the cells and use the visible Borders control instead. The border formatting itself remains part of the workbook when you open it in another supported version of Excel.
Common shortcut problems and fixes
- The letters are not being accepted: press Alt, H, and B one after another. The ribbon KeyTip sequence is not a simultaneous three-key chord.
- The wrong edge appears: check the selection and read the border command name. A bottom border and an outside border affect different edges.
- Internal cell lines are missing: the outline shortcut only frames the range. Choose All Borders if you need boundaries between each selected cell.
- The line is visible on screen but will not print: it may be a gridline rather than a cell border. Apply an actual border, then check print preview.
- A border returns after removal: conditional formatting may be applying a border based on a rule. Review Home > Conditional Formatting > Manage Rules if the appearance changes with cell values.
Another frequent source of confusion is merged cells. A merged range is treated differently from a set of ordinary individual cells, so an internal border may not appear as expected. If the layout permits, unmerge the cells before applying a detailed grid, or format the perimeter of the merged area instead. Also remember that the active cell can remain inside a selection even when the whole range is highlighted; border commands still apply to the selected range, but the active-cell outline is a separate visual indicator.
Choosing the quickest method
Use the direct outline shortcut when you need a simple frame and want to stay on the keyboard. Use the Borders dropdown for specific edges, internal lines, No Border, or heavier styles. Use Format Cells when precise control of color and line style matters. When collaborating with others, prefer a named and visible menu command over an obscure keystroke if that makes the formatting easier to reproduce.
As a simple workflow, format a heading row with a bottom border, apply All Borders only to a compact data table that needs a visible grid, and use an outside or thick outside border to emphasize a total block. Keep borders consistent across similar sections. Before applying a command to a large range, verify the selection in the Name Box or by checking the highlighted cells; a correct shortcut applied to the wrong range can create more cleanup than it saves.
Frequently Asked Questions
What is the shortcut to add a border in Excel?
On Windows, press Alt, H, B in sequence to open the Borders menu, then use the on-screen KeyTip for the border you want. For a quick outline, press Ctrl+Shift+&.
What is the shortcut for all borders in Excel?
There is no need to guess a universal final letter: open the menu with Alt, H, B and choose All Borders using its displayed KeyTip. This adds borders around individual cells and between cells in the selection.
How do I remove all borders with a shortcut?
Ctrl+Shift+_ removes an outline border, but it is not a general remove-all-borders command. To clear every border in a selected range, choose Home > Borders > No Border.
Does Ctrl+Shift+& add borders around every cell?
No. It applies an outline around the selected cell or range. For internal lines between the cells, use All Borders from the Borders menu.
How do I add a bottom border without using the mouse?
Press Alt, H, B, then press the KeyTip displayed beside Bottom Border. KeyTip letters can vary, so use the letter Excel shows in your installation.
Why do borders not show when I print?
Worksheet gridlines and cell borders are different. Gridlines may not print, while explicitly applied cell borders generally do. Check that you applied a cell border and review Print Preview to confirm the result.
Related
- Kuta Scatter Plot Worksheet: How to Find and Use One
- Set Print Area in Excel: Steps, Pages, and Fixes
- Conditional Formatting in Spreadsheets: How It Works
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Archive Emails in Outlook 365To archive an email in Outlook 365, select the message and choose Archive on the toolbar or ribbon.…
- Monthly Budget Template Google Docs: Setup and TipsYes—you can make a monthly budget template in Google Docs by creating a document with a table for…
- Google Sheets Can’t Open Apps Script? Fixes That WorkYes—Google Sheets can open Apps Script in a web browser: open the spreadsheet and choose Extensions > Apps…
- How to Delete a Header from One Page in WordTo delete a header from just one page in Word, isolate that page in its own section, turn…
- Google Sheets Data Validation: How to Show Help TextYes. In Google Sheets in a web browser, select the validated cell or range, open Data > Data…
- Google Sheets Inventory System: Setup, Limits, and TipsYes. You can build a basic inventory system in Google Sheets by keeping a product list and a…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.