How to Add Border Lines in Excel (Step-by-Step)

How-to basics · Updated November 24, 2026

Adding border lines in Excel lets you visually separate data, define table areas, and make your spreadsheet easier to read and print. The quickest way is to select the cells, go to the Home tab, and click the Borders button (the square with a grid icon) in the Font group. From there, choose a preset border style like All Borders or Thick Box Border. This guide walks through every method, including custom borders, line styles, colors, and how to fix common issues.

What You’ll Need

  • Microsoft Excel 2010 or later (instructions are for Microsoft 365 on Windows; Mac differences are noted).
  • A worksheet with data you want to format.
  • Optional: a mouse or trackpad, and a keyboard for shortcuts.

Step-by-Step

  1. Select the cells you want to add borders to. Click and drag to select a range, or click a single cell for just that cell. To select an entire table, click any cell inside it and press Ctrl+A (Windows) or Cmd+A (Mac) once or twice.
  2. Go to the Home tab on the ribbon. Look for the Font group, which contains the Borders button (it looks like a square divided into four quadrants).
  3. Click the Borders dropdown arrow (the small down arrow next to the border icon). A menu appears with preset options: Bottom Border, Top Border, Left Border, Right Border, All Borders, Outside Borders, Thick Box Border, and more.
  4. Choose a preset – for example, click All Borders to add thin lines around every selected cell, or Thick Box Border to put a thick line around the whole selection only.
  5. For more control, click More Borders at the bottom of that menu. This opens the Format Cells dialog box with the Border tab active.
  6. Select a line style from the Style list (e.g., dashed, dotted, thick solid). Then pick a color from the Color dropdown if you don’t want black.
  7. Choose where to apply the border using the preset buttons (None, Outline, Inside) or by clicking directly on the border preview diagram. For example, click the Inside button to add lines between selected cells, and Outline for the outer edge.
  8. Click OK to apply the custom border. The selected cells now show your chosen lines.
  9. To remove borders, select the cells, go to the Borders dropdown, and choose No Border. Or use the keyboard shortcut Ctrl+Shift+_ (Windows) / Cmd+Shift+_ (Mac) to remove all borders from the selection.
  10. Use the Format Painter (Home tab, Clipboard group) to copy borders from one area to another. Click a cell with the desired border, click the Format Painter icon, then select the target range.

Common Mistakes

  • Applying borders to the wrong range – always double-check your selection before adding borders, especially when using All Borders.
  • Using Outside Borders when you meant All Borders – outside borders only add lines around the outer edge, not between cells. This is a frequent mix-up.
  • Borders not printing – by default, borders do print, but if you’ve set the print area incorrectly or have gridlines turned off, it may look like borders are missing. Ensure the print area includes the bordered cells.
  • Mixing border styles unintentionally – when you apply different borders to adjacent cells, Excel may show a conflict. Use the More Borders dialog to set all sides consistently.
  • Forgetting to remove old borders – if you copy formatting, old borders can linger. Use Clear Formats (Home > Editing > Clear > Clear Formats) before reapplying.

Tips

  • Use the keyboard shortcut Ctrl+Shift+& (Windows) / Cmd+Shift+& (Mac) to apply All Borders instantly to the selected cells.
  • Create a custom border style by setting your preferred line style and color in the More Borders dialog, then click OK. Excel remembers your last used settings for the Borders button, so next time you click the button directly, it applies the same style.
  • Use borders to create a clean table look – apply a thick outer border and thin inside lines. Select the range, open More Borders, choose a thick style, click Outline, then switch to a thin style and click Inside.
  • For a professional report, use a subtle gray color for inside lines and a dark blue for the outer border. This is easy with the Color dropdown in the Border tab.
  • If you want gridlines to print (not borders), go to Page Layout > Sheet Options and check the Print box under Gridlines. But note that gridlines are lighter than borders.

Troubleshooting

  • Borders don’t appear on screen – Check if the cells are filled with a color that hides the border. Select the cells, go to Home > Fill Color and choose “No Fill”. Also, zoom out – borders may be too thin to see at low zoom.
  • Borders don’t print – Ensure the print area includes the cells. Go to Page Layout > Print Area > Set Print Area after selecting the range. Also, check that the printer isn’t set to “Draft” quality, which can skip borders.
  • Only some borders show – This often happens when adjacent cells have conflicting border settings. Select the whole range, open More Borders, and reapply all sides consistently.
  • The Borders button is greyed out – This occurs when the worksheet is protected. Go to Review > Unprotect Sheet (enter password if needed).
  • Borders disappear when I type – They shouldn’t, but if you’re using a table style that overrides borders, convert the range to a normal range (Table Design > Convert to Range).
  • Mac: Borders menu looks different – On Excel for Mac, the Borders button is in the same Home tab, but the dropdown may be under a “Borders” submenu. The Format Cells dialog is opened via Cmd+1 and then the Border tab.

Frequently Asked Questions

  1. How do I add a border to a whole column or row?
    Click the column letter or row number to select the entire column/row, then apply borders as usual. Note that this will border every cell in that column/row, even empty ones.
  2. Can I save a custom border style for reuse?
    Yes, but not as a named style. However, you can create a cell style: select a cell with your desired border, go to Home > Cell Styles > New Cell Style, name it, and it will be available in the Cell Styles gallery.
  3. Why do my borders not show when I print from Excel for the web?
    Excel for the web supports borders, but printing may depend on your browser’s print settings. Ensure you select “Print” and check the preview. If issues persist, download the file and print from the desktop app.
  4. How do I add a border around a cell but not the gridlines?
    Select the cell, open More Borders, choose a style, and click the “Outline” preset. This adds a border only around the outside, not inside. Gridlines are separate and can be hidden via View > Show > Gridlines.
  5. Is there a way to add a border to every other row?
    Yes, use Conditional Formatting. Select the range, go to Home > Conditional Formatting > New Rule > Use a formula. Enter =MOD(ROW(),2)=0 for even rows, click Format, go to Border tab, and apply a bottom border. This will automatically apply to every other row.
  6. Can I add a border to a merged cell?
    Yes, select the merged cell, then apply borders. The border will surround the entire merged area. If you want lines inside the merged cell, you cannot – merged cells only have an outer border.

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.