To change a cell border colour in Excel for Microsoft 365 on Windows, select the cells, open Home > Font > Borders, choose Line Color and a colour, then open the Borders menu again and apply the border you want. For more control over individual edges, use Format Cells > Border. You can use these methods for a single cell, a range, or a table area.
What You’ll Need
- An Excel workbook with the cells you want to format.
- A clear idea of which edges should have borders, such as an outside outline, internal gridlines, or just a bottom line.
- Optional: a preferred colour code or a sample cell if you need to match a particular shade.
Border colour is a cell-formatting property, so changing it does not alter the value, formula, or number format in the selected cells. If the workbook is shared or important, save a copy before making broad formatting changes.
Step-by-Step
- Select the cells to format. Click one cell for a single border, or drag across a range. To select non-adjacent cells, hold Ctrl while selecting each range on Windows. On Mac, hold Command. If you want a consistent outline around a whole block, select the entire block before choosing a border. The same action can be repeated for separate areas.
- Open the Borders menu. On the ribbon, select Home. In the Font group, click the small arrow beside the Borders button. Clicking the main part of the button may simply reapply the most recent border, so use the arrow to see the available settings and presets.
- Choose a line colour. In the menu, point to or select Line Color, then choose a colour from the theme or standard colour palette. If you want a custom shade, choose More Colors when it is available and select a colour in the dialog. Choosing a line colour sets the colour for borders you apply; it does not necessarily recolour every existing border in the selection immediately.
- Apply the border you want. Open the Borders menu again and select a preset such as Outside Borders, All Borders, Bottom Border, or Top and Bottom Border. The selected border is drawn using the chosen line colour. Use Outside Borders for a frame around a range; use All Borders when you also want lines between the cells. Avoid choosing All Borders if internal lines would make the sheet too busy.
- Use Format Cells for precise edges. Select the cells, then press Ctrl+1 on Windows to open Format Cells. On Mac, press Command+1. Choose the Border tab. Under line colour, choose a colour; under line style, choose the thickness or pattern. In the preview area, click the specific edge or internal line you want to apply. Click OK when the preview looks right. This is useful when only one side of a cell needs a coloured line or when you need different border edges.
- Recolour an existing border deliberately. If the cells already have borders, select them and open the Border tab in Format Cells. Choose the new colour and click the relevant lines in the preview to replace those existing edges, then click OK. Merely choosing a colour in the ribbon menu may set the colour for the next border you draw rather than change all old lines. Reapplying the desired edge is the reliable way to ensure an existing border changes.
- Check the result at a useful zoom level. Click outside the range and inspect the border against the cell fill and nearby gridlines. If the colour or edge is wrong, reopen the Borders menu or Format Cells and apply the correct edge. Use Undo on Windows with Ctrl+Z or on Mac with Command+Z if you need to reverse the most recent formatting action.
In Excel for Mac, the ribbon and Format Cells dialog provide the same basic border controls, though menu layout and labels can differ slightly between builds. In Excel for the web, select the cells and look under Home for the Borders menu and its colour options; the exact choices may depend on the current web interface. If a particular custom-colour or detailed edge control is missing in the browser, open the workbook in the desktop app and use Format Cells.
Common Mistakes
- Choosing a colour but not applying an edge. Selecting Line Color does not always draw a border by itself. Follow it with a border preset, or click the required line in Format Cells.
- Using the main Borders button instead of its arrow. The main button can repeat the last border command. If you do not see Line Color or the border presets, click the dropdown arrow beside it.
- Expecting every old border to update automatically. A colour selection can affect newly applied borders while existing ones remain unchanged. Reapply the needed lines through the Border tab when changing established formatting.
- Selecting the wrong range. A border may appear to be missing because the selected cells did not include the row or column edge you intended. Check the selection outline before applying the border.
- Confusing worksheet gridlines with borders. Gridlines are the faint guides shown around cells and are not the same as formatted borders. A coloured border remains part of cell formatting; gridline visibility is controlled separately and gridlines do not take on a chosen border colour.
- Choosing a colour that blends into the fill. A pale border on a pale background or a dark border on a dark fill can be hard to see. Check the result at normal viewing size and choose a shade with enough contrast.
Tips
- Match a theme colour where possible. Theme colours are easier to keep consistent with the workbook and may adjust if the workbook theme changes. Use More Colors for a precise brand shade when consistency matters more than theme flexibility.
- Choose the border pattern before applying many edges. Format Cells lets you pick both line style and colour, then add only the edges needed. A thin line is usually easier to read for internal divisions; a heavier line can make an outside frame stand out.
- Use the Format Painter for repeat formatting. If one cell or range already has the exact border colour and edges you need, select it, choose Home > Clipboard > Format Painter, then drag over the destination cells. Format Painter copies other formatting too, such as font, fill, and number format, so check those cells afterwards.
- Apply formatting to a whole range at once. For a rectangular block with a uniform border treatment, select the whole block and apply the preset once. This is quicker and helps avoid gaps caused by formatting cells one by one.
- Keep a simple visual hierarchy. Use one colour for ordinary cell divisions and a stronger colour or thicker line for totals or section boundaries. Too many border colours can make a worksheet harder to scan and print.
- Check print appearance if the sheet will be printed. Coloured lines can look different on paper than on screen, especially when printed in grayscale. Use Print Preview to check whether the important divisions remain visible.
Troubleshooting
The border stays black or another old colour. Select the cells and open Format Cells with Ctrl+1 on Windows or Command+1 on Mac. On the Border tab, choose the intended colour, then click the affected lines in the preview so the existing edges are replaced. Confirm with OK. If the line still looks unchanged, verify that you selected the cells that own that edge and that the chosen colour is not similar to the old one.
No border appears after choosing a colour. Choose a border preset after selecting Line Color, such as Outside Borders, or use the Border tab to click an edge in the preview. Also check that the selected line style is not set to None and that the colour contrasts with the fill. A border on a cell edge can be difficult to notice when the worksheet is zoomed far out.
Only some edges change. A range can have different formatting on its outside and inside edges, and a preset may not target the lines you expected. Open Format Cells and inspect the preview. Click each required edge and internal line individually. For example, to frame a block without inner lines, click the four outside edges and leave the internal lines unselected.
The colour looks different from the shade you selected. Excel can display theme colours differently depending on the workbook theme, cell fill, monitor, or print settings. Try a custom colour from More Colors, then compare it against the cell background at normal zoom. If colour accuracy is important, record the RGB values used and use the same values for other ranges.
The border disappears when you paste or sort. Pasting formatting, clearing formats, or applying a table style can replace cell borders. Reapply the border after the operation, or use paste options that preserve the formatting you need. If the cells are part of an Excel table, the table style may affect their appearance; check the table design options and test the border on a cell outside the table before deciding which formatting method to use.
Frequently Asked Questions
Can I change the border colour of just one side of a cell?
Yes. Open Format Cells with Ctrl+1 on Windows or Command+1 on Mac, select the Border tab, choose a line colour and style, then click only the side you want in the preview.
Can I change the colour of all borders in a selected range at once?
Yes. Select the range and use Format Cells > Border to choose the colour and reapply the required outside and internal edges. Check the preview before confirming, because existing border patterns may not all be identical.
Why does my border colour not show in Excel?
The line may not have been reapplied after choosing a colour, the line style may be None, or the colour may blend into the cell fill. Apply the edge again in Format Cells and check it at normal zoom.
Can I enter an exact custom border colour?
In desktop Excel, choose More Colors from the colour palette when available and use the custom colour controls. The browser version may offer fewer detailed controls, so use desktop Excel if you need a particular RGB shade.
Are borders and gridlines the same thing?
No. Borders are formatting applied to selected cells and can have chosen colours and line styles. Gridlines are worksheet guides, and changing their display does not recolour cell borders.
Will coloured borders appear when I print?
Usually, formatted borders print with the sheet, but the result depends on printer and print settings. Check Print Preview, especially if the document may be printed in grayscale or on a low-quality printer.
Related
- How to Add in Excel Across Different Sheets
- How to Add an Image in Excel: Step-by-Step
- Add a Drop-Down in Excel and Color Its Selected Cells
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 Enable Autofit in Excel for Columns and RowsTo AutoFit in Excel, select the column or row, then double-click the boundary on its right or bottom…
- Excel 3-Digit Number Format: Show Leading ZerosTo display numbers as three digits in Excel, apply the custom number format 000: select the cells, press…
- Compare Names in Two Excel Sheets: Find MatchesTo compare names on two Excel sheets, put the names in columns and use a formula such as…
- COUNTIF Dropdown in Google Sheets: Count SelectionsTo count choices made in a Google Sheets dropdown, use COUNTIF on the cells containing the dropdowns. For…
- Excel Work Timesheet Template: Build One That Adds Work HoursAn Excel work timesheet template can be made with columns for the date, start time, end time, unpaid…
- Excel Conditional Formatting for Yes/No Red and GreenYes—Excel can automatically color “Yes” green and “No” red with conditional formatting. For a status list in B2:B100,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.