sodcalculator

10 Tech How-To

How to Draw Borders and Border Grids in Excel

Guide 10-14998 · Updated · Step by step

This guide shows you how to apply borders and gridlines in Microsoft Excel, turning a plain spreadsheet into a clearly organized table. You’ll learn how to add borders to selected cells, draw custom border lines, and control which lines appear. No prior Excel experience is needed—just a working spreadsheet with data in it.

What You’ll Need

  • A computer with Microsoft Excel installed (2016, 2019, 2021, or Microsoft 365 all work the same way for these steps).
  • A spreadsheet with some data entered—borders are applied to cells that already contain content, so have your table filled in first.

Step-by-Step

Method 1: Applying a Standard Border to a Cell Range

  1. Select the cells you want to border. Click and drag over the range, or click the top-left cell, hold Shift, and click the bottom-right cell.
  2. Go to the Home tab on the ribbon at the top of Excel.
  3. Find the Font group—it’s in the middle of the Home tab, next to the alignment options.
  4. Click the Borders button (it looks like a square divided into four smaller squares). A dropdown menu appears.
  5. Choose a border style from the list. The most common options are:
    • All Borders—adds a thin line around every cell in your selection.
    • Outside Borders—adds a border only around the outer edge of the entire selection.
    • Thick Box Border—a heavier line around the outside.
    • Bottom Border—adds a line under each row in the selection.
  6. Check the result. The borders appear immediately on your sheet.

Method 2: Drawing Borders Manually

  1. Select the cells where you want to draw borders.
  2. Click the Borders dropdown on the Home tab.
  3. Choose “Draw Border” from the bottom of the menu. Your cursor changes to a pencil icon.
  4. Click and drag along the edges of cells to draw lines. Drag horizontally to draw a horizontal line, vertically for a vertical line.
  5. Press Esc when you’re done drawing to exit the drawing mode.

Method 3: Using the Format Cells Dialog for Full Control

  1. Select the cells you want to format.
  2. Right-click anywhere in the selection and choose Format Cells from the context menu.
  3. Click the Border tab at the top of the dialog box.
  4. Choose a line style from the Style box on the left (solid, dashed, dotted, thick, etc.).
  5. Pick a color from the Color dropdown if you don’t want black.
  6. Click the preset buttons (None, Outline, Inside) or click directly on the border preview diagram in the middle to toggle individual lines on and off.
  7. Click OK to apply your settings.

Method 4: Removing Borders

  1. Select the cells with borders you want to remove.
  2. Go to the Home tab and click the Borders dropdown.
  3. Choose “No Border” from the menu. All borders in the selection are removed.

Method 5: Working with the Grid (Gridlines)

  1. Understand the difference: gridlines are the light gray lines that appear by default on every sheet. Borders are lines you add manually. Gridlines don’t print by default; borders do.
  2. To show or hide gridlines, go to the View tab and check or uncheck the Gridlines box in the Show group.
  3. To change gridline color, go to File > Options > Advanced, scroll to “Display options for this worksheet,” and pick a color from the Gridline color dropdown.
  4. To print gridlines, go to the Page Layout tab, check the Print box under Gridlines in the Sheet Options group.

Common Mistakes

  • Applying borders to the wrong range—if you select one cell and add “All Borders,” you only get a border around that single cell, not the whole table. Always select the full range first.
  • Confusing gridlines with borders—gridlines are light gray and only visible on screen (unless you enable printing). Borders are solid lines you control. If your printed sheet has no lines, you likely didn’t add borders.
  • Using the eraser incorrectly—the Erase Border tool (in the Draw Borders submenu) removes only the lines you drag over, not all borders. If you want to clear everything, use “No Border” instead.
  • Forgetting to press Esc after drawing—if your cursor stays as a pencil, every click adds a border. Press Esc to return to normal selection mode.
  • Adding borders to merged cells—when cells are merged, borders apply to the merged area as one unit, which can look unexpected. Unmerge first if you need individual lines.

Tips

  • Use keyboard shortcuts: select cells and press Ctrl+Shift+& to add all borders, or Ctrl+Shift+_ (underscore) to remove all borders.
  • Create a custom border style you reuse often by setting it up once in Format Cells, then use the “Draw Border” tool with that style.
  • Use borders to separate data visually—thick outer borders for the table edge, thin inner lines for rows and columns, and a double line under a totals row.
  • Copy formatting with Format Painter—after setting up one table nicely, select it, click the Format Painter brush (Home tab), then click another range to copy the borders.
  • Set a default border style for new workbooks by saving a template file (.xltx) with your preferred borders already applied.
  • Use conditional formatting borders to automatically highlight cells that meet criteria—go to Home > Conditional Formatting > New Rule, then use the Format button to add a border.

Troubleshooting

  • Borders don’t appear on screen: check that you’re not in Page Break Preview mode (View tab > Workbook Views). Switch back to Normal view. Also verify the cells aren’t white-on-white—check the Fill Color is set to No Fill.
  • Borders don’t print: go to Page Layout > Sheet Options and make sure the Print checkbox under Gridlines is checked if you want gridlines, but note that borders always print. If borders still don’t print, check your printer’s “print backgrounds” setting—some printers skip background graphics.
  • Borders look wrong after sorting or filtering: borders are attached to cells, not data. When you sort, the borders stay with the cells, not the values. Reapply borders after sorting if needed.
  • Can’t see the Borders button: it might be hidden if your window is narrow. Click the “More” (three dots) button at the end of the Font group, or widen the Excel window.
  • Drawing border tool won’t draw: make sure you’ve selected “Draw Border” and not “Draw Border Grid”—the latter only draws inner lines. Also check that the sheet isn’t protected (Review tab > Unprotect Sheet).

Frequently Asked Questions

What’s the difference between gridlines and borders?

Gridlines are the light gray lines that appear by default across every sheet. They’re only visible on screen and don’t print unless you enable that option. Borders are lines you manually add to specific cells—they’re black by default, print normally, and move with the cells when you copy or move them.

How do I add a border to an entire row or column?

Click the row number (e.g., “5”) or column letter (e.g., “C”) to select the entire row or column, then apply any border style from the Home tab. The border will extend across all cells in that row or column.

Can I save a custom border style to use again?

Yes. Set up your border in Format Cells, then select the cells and copy them (Ctrl+C). When you want to reuse the style, select new cells, right-click, and choose Paste Special > Formats. Alternatively, save the entire workbook as a template (.xltx) with the borders already applied.

Why do my borders disappear when I copy and paste?

If you use Paste (Ctrl+V), borders are copied along with cell contents. But if you use Paste Special and choose only “Values,” borders are not included. Use Paste Special > Formats to paste just the border styling, or paste everything with Ctrl+V.

How do I make a thick border around a table but thin lines inside?

Select the entire table, open Format Cells > Border tab, choose the thick line style, click “Outline” preset. Then, still in the same dialog, choose the thin line style and click “Inside” preset. Click OK—you’ll have a thick outer edge and thin inner lines.

Is there a way to add diagonal borders to a cell?

Yes. Select the cell, open Format Cells > Border tab. In the border preview diagram, click the diagonal line buttons (the two lines that go from corner to corner). This is often used for headers to split a cell into two visual sections.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →