The quickest way to add lines in Excel

To add a line around a cell or group of cells in Excel, select the cells you want to border, then go to the Home tab and click the Borders button in the ribbon. A dropdown menu appears with preset options like "All Borders," "Outside Borders," or "Bottom Border." Click the option that matches what you need, and Excel applies it instantly.

If you want more control over which edges get lines, click the small arrow next to the Borders button to open the full menu. At the bottom of that menu, select More Borders to open the Format Cells dialog, where you can choose exactly which sides of which cells receive lines, what style the line should be, and what color.

Key Takeaways

  • The Borders button on the Home tab offers preset line options that work for most common tasks like outlining a table or adding a bottom border to a header row.
  • The Format Cells dialog (accessed via More Borders) lets you control line style, color, and which specific edges of cells get lines when presets do not match your needs.
  • You can remove lines by selecting the bordered cells and choosing "No Border" from the Borders dropdown.
  • Lines you add in Excel are formatting only — they do not affect calculations or data, and they print by default unless you change print settings.

Using the Borders dropdown for common layouts

The Borders button dropdown includes several ready-made options that handle the layouts you use most often. "All Borders" puts a line on every edge of every selected cell, which is useful for creating a grid or table. "Outside Borders" draws a line only around the perimeter of your selection, leaving the interior cells without internal lines — this works well for highlighting a summary section or a block of related data.

"Top Border" and "Bottom Border" add a single line to just the top or bottom edge of your selection. These are common for separating headers from data or marking a total row. "Left Border" and "Right Border" work the same way on the vertical edges. If you have already applied borders and want to remove them, select the cells and choose "No Border" from the same dropdown.

Opening the Format Cells dialog for detailed control

When the preset options do not match what you need, open the Format Cells dialog by clicking the arrow next to Borders and selecting More Borders. This dialog has three tabs: Line, Border, and Fill. Stay on the Border tab to add or change lines.

On the left side of the Border tab, you see a preview of your selection. On the right, you choose a line style (solid, dashed, dotted, or double), a line weight (thickness), and a color. Below that are preset arrangements like "Box" or "Grid," or you can click directly on the preview to toggle lines on individual edges. For example, click the top edge of the preview box to add a line only to the top of your selection, or click it again to remove that line.

Once you have set up the lines the way you want them, click OK to apply the formatting to your selected cells.

Applying the same border to multiple separate areas

If you need to add the same border style to cells that are not next to each other, select all of them at once before opening the Borders menu. Hold Ctrl (or Cmd on Mac) and click each cell or range you want to include. When you apply a border, it affects all the selected areas with a single action.

This method saves time when you are formatting a spreadsheet with multiple tables or sections that need matching borders. After you release the mouse, all your selections remain highlighted in blue, and any border you apply goes to every one of them.

Changing line color and style

The Format Cells dialog lets you customize how your lines look beyond just their placement. In the Line section, click the Color dropdown to choose a different color for your borders — the default is black, but you can pick any color from the palette or use a custom color if your spreadsheet uses a specific design scheme.

The Style dropdown offers different line patterns: solid lines, dashed lines, dotted lines, and double lines. The Width dropdown controls thickness, ranging from thin hairlines to thick borders. These options are useful when you want borders to stand out more or when you are creating a formatted report that needs visual hierarchy — for example, a thicker border around a summary section and thinner lines between data rows.

Removing borders from cells

To remove borders from cells that already have them, select those cells, click the Borders button, and choose No Border. This removes all borders from the selection in one step.

If you want to remove borders from only certain edges — for example, removing the bottom border but keeping the top border — open the Format Cells dialog via More Borders, and in the preview box, click the edges you want to remove. Each click toggles that edge on or off. When you have removed the edges you do not want, click OK.

How borders print and display on screen

Borders you add in Excel print by default. If you do not want borders to appear on a printed copy of your spreadsheet, you need to remove them before printing, or you can adjust your print settings to hide gridlines (though this is a different feature from borders you have added).

On screen, borders appear as solid lines between cells. They do not affect the data in the cells, formulas, or any calculations — they are purely visual formatting. If you share your spreadsheet with someone else, the borders travel with the file and appear the same way on their screen.

Frequently Asked Questions

Can I add a border to just one side of a cell?

Yes. Open the Format Cells dialog by clicking the arrow next to Borders and selecting More Borders. In the preview box on the left, click the specific edge you want to add a line to — top, bottom, left, or right. Click OK to apply it.

What is the difference between borders and gridlines?

Gridlines are the faint gray lines that appear between all cells by default in Excel — they help you read the spreadsheet but do not print. Borders are lines you add yourself through the Borders menu, and they do print. You can turn gridlines on or off in the View tab without affecting any borders you have added.

Do borders affect how my data sorts or filters?

No. Borders are formatting only and have no effect on data, sorting, filtering, or calculations. You can add or remove borders without changing anything about how your spreadsheet works.

Can I copy borders from one cell to another?

Yes, using the Format Painter. Click a cell that has the borders you want to copy, click the Format Painter button (the paintbrush icon) on the Home tab, then click the cell or select the range where you want to paste those borders.

Why do my borders look different when I print?

Borders may appear thinner or lighter on a printout depending on your printer and print quality settings. If borders are not showing up at all, check your print settings to make sure you have not selected an option to print without borders or in draft mode.