To add a black border in Excel, select the cell or range, open Home > Borders > More Borders, choose black under Color, select the border lines you want, and click OK. A border marks cell edges without changing the cell’s contents or fill, making headings, totals, and data blocks easier to distinguish.
The steps below are for Excel for Microsoft 365 on Windows. You can add a border to one cell or a whole selection, and you can choose whether it appears around the outside, between cells, or on particular sides. If you only need a quick black outline, Excel’s Borders menu also offers shortcuts; the full Format Cells dialog gives you more control over color and line style.
What You’ll Need
- A workbook open in Excel and the cells you want to format. If you are changing a shared workbook, make sure you have permission to edit it.
- A rough idea of the border layout you need: an outline around the range, lines between every cell, or only selected edges.
You do not need to change the font, fill color, or worksheet theme. Borders are separate formatting, so adding one will not erase the values or formulas in your selected cells.
Step-by-Step
- Select the target cell or range. Click one cell to border a single cell. To format a block, click the first cell and drag to the last, or click the first cell, hold Shift, and click the last. You can also select a range by clicking the Name Box to the left of the formula bar, typing an address such as
B2:E8, and pressing Enter. Check the highlighted area before changing its formatting; borders apply to the selection, not just the active cell. - Open the border controls. On the ribbon, select Home. In the Font group, find the Borders button, shown as a small square grid. Click the arrow beside it rather than the main button, which may repeat the last-used border command. Choose More Borders at the bottom of the menu to open the Format Cells dialog on its Border tab.
- Choose a visible line style. In the dialog’s Style area, click the line you want, such as a thin solid line. A thicker line can make a table’s outside edge stand out, while thin lines are usually easier to read between ordinary data cells. Choose the style before selecting the edges so you can see the intended line in the preview.
- Set the border color to black. Open the Color selector and choose black from the standard color choices. If the palette shows theme colors and standard colors, use the black swatch rather than a dark gray. The dialog preview updates to show the selected color. If the exact shade matters for a report, inspect the palette carefully; a nearly black theme color can look different when printed.
- Apply the border to the outside of the selection. In the dialog’s preview area, click the outline icon or click the top, bottom, left, and right edges of the preview. This places a black frame around the selected range while leaving the interior cell boundaries unchanged. Check the preview before proceeding so you do not accidentally add internal lines too.
- Add internal lines if you need a grid. To separate every cell in a selected block, click the Inside preset as well as Outline, or click the internal horizontal and vertical lines in the preview. The outline marks the range’s perimeter; inside borders divide the cells within it. Use both for a complete grid, or use only the edges that support the information’s layout.
- Apply your choices. Click OK to close the dialog and return to the worksheet. The border should appear around the selected cell or range. Click a blank cell outside the selection to inspect the result without the selection highlight, which can make thin edges harder to see.
- Use a quick command for a simple outline. If the current border color is already black, select the range, open Home > Borders, and choose Outside Borders for a perimeter only or All Borders for a grid. These menu commands apply the current border settings, so use More Borders first when you need to set or verify the color. The same menu includes commands such as Bottom Border for emphasizing a heading or total.
- Save and check the result at useful zoom. Save the workbook, then view the formatted area at a normal zoom level. If the cells will be printed, use File > Print to preview the page. Borders may look heavier or lighter depending on zoom, printer, and scaling, so confirm that the grid remains readable at the size people will use.
For example, to frame a report total in cells B2:E8 without boxing every value, select B2:E8, set a black thin or medium line in More Borders, and apply Outline only. To make a full table grid, apply the same color and line style to both the outline and inside edges. The worksheet data stays the same in either case; only the appearance changes.
On a Mac, the border controls are also on the Home tab, though the ribbon layout can differ slightly. You can open Format Cells with Command+1 and use its Border tab. In Excel for the web, select the cells and look for the border controls on Home; some dialog options may be arranged differently or be more limited than in the desktop app. If you cannot find the color or line controls you need, open the workbook in desktop Excel.
Common Mistakes
Choosing a border command before setting the color. The quick Outside Borders and All Borders options use the current border settings, which may be a previous color or style. If the result is gray, colored, or unusually thick, reopen More Borders, choose black and the intended line style, and apply the edges again.
Clicking the main Borders button instead of its arrow. The main button can apply the most recently used border directly. If it does not open the menu, click the small arrow beside it. From there, choose More Borders to set specific options.
Selecting too many or too few cells. Excel applies the command to the current selection. A stray selected row or column can add borders outside the intended table, while selecting just one cell will not create a grid over the entire block. Confirm the highlighted range before you open the border dialog.
Confusing borders with gridlines. Worksheet gridlines are the faint guides Excel displays around cells by default; they are not the same as cell borders. Gridlines may be hidden or may not print, while borders are explicit formatting and can be printed. Adding a black border is the right choice when the lines need to remain visible in a shared file or printed report.
Using inside borders when you only want an outline. Inside lines divide each cell in the range and can make a compact table look crowded. For a simple frame, apply Outline only. For a full grid, apply both the outline and inside lines.
Tips
Pick a border layout that explains the data rather than decorating every cell. A black outline can define a table, while a bottom border beneath a header can separate labels from records without adding a box around every value. For a totals row, a top border can create a clear break from the detail above it.
Use line weight consistently. Thin black lines suit most tables and preserve visual space. A medium or thick line is useful for an outer frame or a major section break, but using heavy lines on every cell can distract from the values. If a table has many rows or columns, try a thin inside grid and a slightly stronger outline.
You can apply different edges to different parts of a selection. For instance, select a heading row and apply only a bottom border, then select the entire table and apply an outline. Because the later selection may change edges shared with earlier formatting, inspect the result after each operation. To create a clean structure, format the larger range first and then add special heading or total edges.
To reuse a good layout, copy a correctly formatted cell or range and use Home > Paste > Paste Special > Formats on another selection. This copies formatting, including borders, without replacing the destination’s values. Check the destination afterward because the copied border pattern may not fit a differently sized range exactly.
When the border is meant to help readers scan figures, keep the worksheet’s other formatting restrained. A strong black frame paired with a very dark fill or many bold lines can reduce contrast. For printed worksheets, consider whether the border is still clear in grayscale and whether scaling the sheet to fit a page makes thin lines difficult to see.
Troubleshooting
The border does not appear. First click outside the range to remove the selection highlight. Then check that you selected a border edge in the dialog preview and clicked OK. If it is still missing, reopen More Borders and verify that the color is black and a line style is selected. A color choice alone does not add a border; at least one edge must be enabled.
The border is the wrong color. Select the affected cells, open Home > Borders > More Borders, choose black under Color, select the appropriate edges again, and click OK. Choosing a new color without clicking an edge in the preview may not replace the existing border. If the line looks dark gray on screen, check whether the selected swatch is actually black and inspect a print preview before changing other formatting.
Only some cells have lines. You may have applied Outline rather than Inside, or the selection may not cover the whole table. Select the full table range and apply the desired inside and outside edges. If some edges remain different, reopen the dialog and use the preview to set each required side; border formatting can vary from cell to cell within a range.
Lines appear doubled or heavier than expected. Adjacent cells can each have a border on their shared edge, and different line styles can make that boundary look unusually heavy. Select the affected area, choose one consistent style, and reapply the intended outline and inside borders. For a simple table, a single thin style throughout is a useful way to reset its appearance.
The border is visible onscreen but absent from a printout. Confirm it is a cell border rather than a worksheet gridline, then check File > Print and the printer preview. Review page scaling and printer settings, and consider a slightly thicker black line if a very thin border disappears at the printed size. If the workbook is being exported to PDF, inspect the exported page too.
You cannot edit the border. The worksheet may be protected or the file may have opened in read-only mode. Check Review > Unprotect Sheet if you have permission and the password, or request edit access to the workbook. Do not remove protection or overwrite a shared file unless you are authorized to do so.
Frequently Asked Questions
How do I add a black border to just one cell?
Select the cell, go to Home > Borders > More Borders, set the color to black, choose a line style, and click the desired edges in the preview. Click OK to apply it.
How do I put a black border around a range without lines inside it?
Select the range, choose a black line in the Border tab of Format Cells, and apply Outline only. Do not select Inside if you want the range to remain visually open within its perimeter.
How do I add black lines between every cell in a range?
Select the full range, set black as the border color, and apply both Outline and Inside in the Format Cells dialog. You can also use All Borders in the Borders menu after confirming the current color and style.
Will a black cell border print?
Usually, yes. Cell borders are formatting, unlike worksheet gridlines, which may not print. Check File > Print to confirm the border is visible with your page layout, scaling, and printer settings.
How can I remove a black border?
Select the affected cells, open Home > Borders, and choose No Border. This removes borders from the selection, so take care not to include neighboring cells whose borders you want to keep.
Can I change border thickness as well as color?
Yes. In Home > Borders > More Borders, choose a line in the Style area and then choose black under Color. Click the edges you want to change in the preview and select OK.
Related
- How to Average Dates in Excel
- Hotel Laundry List Template Excel: Setup and Use
- Capitalize in Excel: Shortcuts and Reliable Alternatives
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Data Validation for Dates: Rules and ExamplesIn Excel for Microsoft 365 on Windows, date validation restricts what dates users can enter in selected cells.…
- Excel Table: Print Headers on Every PageYes. In Excel for Microsoft 365 on Windows, open Page Layout > Print Titles and set the table’s…
- Google Sheets IFS Formula: Syntax, Examples, and FixesIn Google Sheets, the IFS function checks conditions in order and returns the value paired with the first…
- Keep the Home Tab Open in Excel: Show the RibbonTo keep Excel’s Home tab visible, expand the ribbon, choose the option to always show it, and click…
- Track Changes in Microsoft Word: Review and Manage EditsTo use Track Changes in Microsoft Word, open the document, select Review > Track Changes, and edit as…
- Google Sheets UNIQUE Function: How to Find Distinct ValuesTo list distinct values in Google Sheets, enter =UNIQUE(A2:A) in an empty cell, replacing A2:A with your data…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.