The fastest way to add lines in Excel
The quickest method is to select the cells where you want lines, then use the border tool in the Home tab. Click the small arrow next to the border icon (it looks like a grid), choose your line style from the dropdown menu, and Excel applies it instantly. This works for adding lines around cells, between rows, or along the edges of a data range.
If you need lines around a single cell or a small group, select those cells first. Then go to Home > Borders (the dropdown arrow next to the grid icon) and pick "All Borders" to put lines on all four sides, or choose a specific option like "Outside Borders" for just the outer edge.
Key Takeaways
- The border tool in the Home tab is the standard way to add lines; select cells first, then choose your border style from the dropdown menu.
- You can add lines to the outside of a range, inside between cells, or to specific sides of individual cells depending on what you select.
- The border gallery shows preset options like "All Borders" and "Grid", but you can also customize line color, thickness, and style through Format Cells.
- Lines you add are formatting only and do not affect your data or calculations.
Adding borders to a range of cells
To add lines around a block of data, first highlight all the cells you want to include. Click and drag from the top-left cell to the bottom-right, or click the first cell, hold Shift, and click the last cell.
Once your range is selected, go to the Home tab at the top of the ribbon. Look for the Borders button — it is in the Font group and shows a small grid icon. Click the small arrow next to it to open the border menu. Choose "All Borders" to put lines around every cell in your selection, or pick "Grid" for the same effect with a slightly different appearance.
Choosing different line styles and colors
Excel's border dropdown menu offers several preset options, but you can customize the line style, thickness, and color if you need something different. Select your cells, then right-click and choose "Format Cells" from the context menu. You can also go to Home > Format > Format Cells.
In the Format Cells dialog, click the Border tab. On the left side, you will see a preview of your cell. In the middle, choose a line style from the list — solid lines, dashed lines, dotted lines, and others are available. Use the Color dropdown to pick a different color, and the Width dropdown to make lines thicker or thinner. Click the preset buttons on the right ("Outline", "Inside", "All") or click directly on the preview to add lines to specific sides of your cells.
Adding lines between rows or columns only
Sometimes you want horizontal lines between rows but not vertical lines between columns, or vice versa. Select the range where you want this effect, then open the border menu in Home > Borders. The dropdown shows options like "Inside Horizontal" (lines between rows only) and "Inside Vertical" (lines between columns only).
If these presets do not match what you need, use Format Cells instead. Select your range, right-click, choose Format Cells, go to the Border tab, and click directly on the preview diagram to add or remove lines from specific sides. You can build exactly the pattern you want by clicking the edges and interior lines in the preview.
Removing or changing existing lines
If you have already added borders and want to remove them, select the cells with the lines, open the border menu, and choose "No Border". This removes all lines from your selection at once.
To change only some of the lines — for example, to make them thicker or a different color — select the cells again and go to Format Cells > Border tab. The preview will show your current borders. Adjust the style, color, or width, then click the preset or draw on the preview to apply only the changes you want.
Using borders for readability in large spreadsheets
Adding lines strategically makes large spreadsheets easier to read. A common pattern is to put a thicker border around the outside of your data range and thinner lines inside to separate rows and columns. You can also use borders to highlight header rows — add a thicker bottom border under your column headers to visually separate them from the data below.
Another useful technique is to add borders only to the left and right of certain columns to group related data together, or to add a bottom border to a total row so it stands out from the rows above. Borders are purely visual and do not change how Excel calculates or sorts your data.
Frequently Asked Questions
Can I add a border to just one side of a cell?
Yes. Select the cell, go to Home > Format > Format Cells, click the Border tab, and click the specific edge in the preview diagram where you want a line. You can add a line to the top, bottom, left, right, or any combination.
Do borders print when I print my spreadsheet?
Yes, borders print by default. If you do not want them to print, select the cells with borders, go to Format Cells > Border tab, and choose "No Border" before printing. You can also adjust print settings to exclude borders if you prefer.
What is the difference between borders and gridlines?
Gridlines are the faint gray lines Excel shows on screen to help you see cells — they do not print. Borders are lines you add as formatting that do print and appear darker. You control gridlines separately under the View tab.
Can I copy borders from one cell to another?
Yes, use the Format Painter tool. Click a cell with the borders you want to copy, click the Format Painter icon in the Home tab (it looks like a paintbrush), then click or drag over the cells where you want those borders applied.