Excel Practice Test

โ–ถ

The Fastest Way to Add Borders in Excel

Borders in Excel turn a flat block of numbers into a readable table. They tell the eye where one record ends and the next begins. They separate totals from line items. They mark the boundary of a print area before paper hits the tray. Yet most spreadsheet users still click the same single button on the ribbon and never explore what the borders engine can actually do. This guide walks through every method, from the one-second keyboard shortcut to custom cell styles you can reuse across workbooks.

If you only need a fast box around your data right now, select your range, press Ctrl + Shift + 7 on Windows or Cmd + Option + 0 on Mac, and you're done. That places an outline around the selection. For an inside grid as well, click the small arrow next to the Borders button on the Home tab and choose All Borders. Everything else in this article is for when you want more control, cleaner print output, or consistent styling across multiple worksheets.

Open the workbook you want to format and select the cells. The Borders button sits on the Home tab in the Font group. It looks like a small square divided into four quadrants. Click the button itself to apply the last-used border style. Click the arrow next to it to open the dropdown menu. From there, choose All Borders for a complete grid, Outside Borders for just the perimeter, Thick Box Border for a heavier outline, or Bottom Border to mark a totals row.

The Borders dropdown also exposes line drawing tools. Pick Draw Border and your cursor becomes a pencil. Click and drag to paint borders cell by cell. Pick Draw Border Grid to fill a whole range as you drag. Pick Erase Border to remove segments without nuking the rest. Press Esc to drop the pencil when you finish. This mode is useful when a complex layout has borders in some places but not others and you don't want to click through the menu twenty times.

Keyboard shortcuts speed things up once you stop reaching for the mouse. Ctrl + Shift + 7 applies an outline. Ctrl + Shift + _ (underscore) removes all borders from the selection. On Mac, the equivalents are Cmd + Option + 0 and Cmd + Option + Hyphen. Combined with the Name Box (top-left, where you can type a cell range like A1:G50 and press Enter to select it), you can box up massive ranges in under three seconds without scrolling.

The ribbon dropdown only covers ten or so presets. For anything else, open the Format Cells dialog with Ctrl + 1, then click the Borders tab. This is where Excel exposes the full borders engine. You get a preset row (None, Outline, Inside), a style list (thin, medium, thick, dashed, dotted, double), a color picker, and a preview pane. Click the preview edges or the eight surrounding buttons to add or remove individual lines. This is the only way to mix styles, like a thick outside and a thin inside grid.

Borders in Excel at a Glance

๐Ÿ“
13
Border Presets in Ribbon
๐Ÿ“
13
Line Styles Available
โŒจ๏ธ
<1s
Keyboard Shortcut Speed
๐ŸŽจ
16M
Custom Border Colors

Select your range with the Name Box (type A1:G50, press Enter). Press Ctrl+1 to open Format Cells. Click Borders. Pick a thin line style, click Inside. Pick a medium line style, click Outline. Click OK. Done โ€” clean framed table in 5 seconds.

Advanced Border Techniques

A pattern that shows up in nearly every clean spreadsheet design is the thick-outside, thin-inside table. Select your range. Open Format Cells with Ctrl + 1. On the Borders tab, pick a thin line style first and click Inside. Then pick a thick or medium style and click Outline. Click OK. You now have a framed table where the perimeter pops and the gridlines stay quiet. The same workflow lets you add a thick double line under a header row by selecting only that row and choosing a double style for the bottom edge.

Diagonal borders are useful for crossed-out cells, especially in inventory or scheduling sheets where you want to mark something as not applicable without deleting the data. In the Format Cells Borders tab, the bottom two buttons under the preview are the diagonal options. The left one runs from top-left to bottom-right. The right one runs from bottom-left to top-right. Combine them for an X. You can pair a diagonal line with normal cell borders and even split a cell with text on each side of the diagonal using line breaks.

Color matters more than people think. A black border on a white sheet is the default, but it can fight with the data when you have a lot of it. A medium gray border, around RGB 191,191,191, gives the same visual structure with less noise. To set color, open Format Cells, go to Borders, click the Color dropdown, pick a hex or RGB value under More Colors, then click the edge or preset you want to color. The color applies to whichever lines you add after you set it.

Cell styles are how you stop redoing the same formatting work. On the Home tab, click Cell Styles, then New Cell Style. Name it something like Table Header or Total Row. Click Format, set up the borders, fill, font, and number format you want, and click OK. The style now lives in the workbook and shows up in the Cell Styles gallery. To apply it, select cells and click the style. To share styles across workbooks, use the Merge Styles button at the bottom of the gallery.

Excel converts a range into a structured Table when you press Ctrl + T with cells selected. Tables come with their own banding and borders, controlled from the Table Design tab. The Table Styles gallery has dozens of presets covering header borders, total row borders, banded rows, banded columns, and first/last column emphasis. This is the fastest way to get a polished look on tabular data and the formatting follows the table when you add rows. Tables also fix common print problems because Excel handles row boundaries automatically when content extends.

Conditional formatting can apply borders based on cell values, not just colors and icons. Select your range. Click Home, Conditional Formatting, New Rule. Pick Format only cells that contain, set your condition, click Format, go to the Borders tab, and choose a border. Now any cell that meets your condition gets that border. A common use is putting a thick bottom border under every grouping change in a sorted list, by using a formula rule like =A2<>A3 and applying a bottom border to the matching rows.

Removing borders is just as important as adding them. Three options exist. First, select the range and click No Border from the Borders dropdown on the Home tab. Second, use Ctrl + Shift + _ on Windows. Third, open Format Cells with Ctrl + 1, click the Borders tab, and click the None preset. If borders remain after all three, check whether the gridlines visible toggle is on under the View tab. Gridlines and borders look similar but are different layers, and gridlines only show on screen, not on prints.

The Four Places Borders Live in Excel

๐Ÿ”ด Home Tab Dropdown

Quick presets like All Borders, Outside Borders, and Bottom Border. Best for fast one-off formatting on small ranges.

๐ŸŸ  Format Cells Dialog

Press Ctrl+1, click Borders. Full control over line style, color, and edge selection. The only place to mix thin and thick lines.

๐ŸŸก Cell Styles Gallery

Reusable formatting bundles. Save your border scheme as a named style and apply it across the workbook in one click.

๐ŸŸข Conditional Formatting

Apply borders based on cell values or formula results. Great for adding a separator line between groups in a sorted list.

Test Your Excel Knowledge

Platform Differences and Troubleshooting

Speaking of prints, borders are the only horizontal and vertical separation that actually appears on paper by default. Gridlines do not print unless you flip a switch under Page Layout, Sheet Options, Gridlines, Print. Many users add borders specifically to control how a printed sheet looks because gridlines are inconsistent across versions and printers. Before sending a sheet to PDF or paper, check Page Layout, click Print Titles, go to the Sheet tab, and confirm that Gridlines is unchecked if you only want your borders to show.

Excel for the web supports a smaller subset of border controls than the desktop app. You can apply outline, inside, all, top, bottom, left, and right borders from the Home tab. You can change color. You cannot draw borders by hand, you cannot set custom line styles like double or dashed, and you cannot use cell styles from the gallery the same way. If you need advanced borders in a workbook that lives in OneDrive, do the formatting in the desktop app first, save, then continue editing in the browser.

Excel for Mac uses the same Format Cells dialog as Windows but with a slightly different layout. The keyboard shortcut to open it is Cmd + 1. The borders panel is on a tab labeled Border (singular). All the same controls exist, including diagonal lines, presets, line styles, and colors. The big difference is that some keyboard shortcuts use Option instead of Alt. Cmd + Option + 0 applies an outline. The Draw Border tools work the same as on Windows once you find them under the Borders dropdown on the Home tab.

Common problems are easy to fix once you know what's happening. If borders look uneven on screen, zoom to 100 percent because Excel rounds line positions at lower zoom levels. If a thick border disappears when you copy the cell, you probably used the Format Painter on a single cell rather than the range. If a border shows on one cell but not the adjacent one, two cells share the same edge and one cell's setting overrode the other. Apply your borders to the whole range at once instead of cell by cell to avoid this.

If you handle Excel data daily for work or school, building speed with borders is one of the small wins that adds up. Pair it with mastery of conditional formatting and Excel keyboard shortcuts and you can format a 1,000-row dataset in under a minute. Test your overall Excel knowledge on our Excel practice test to see how many border-related questions you can answer correctly before exam day.

VBA gives you programmatic control when you need to format hundreds of similar reports. The basic pattern is Range("A1:G50").Borders.LineStyle = xlContinuous for a full grid, or Range("A1:G50").BorderAround Weight:=xlMedium for just an outline. You can target individual edges with Borders(xlEdgeTop), xlEdgeBottom, xlEdgeLeft, xlEdgeRight, xlInsideHorizontal, and xlInsideVertical. Each edge has a LineStyle, Weight, and Color property. Set them in a macro, assign it to a button on the Quick Access Toolbar, and you have one-click standard formatting across every report your team produces.

Border Shortcuts by Platform

๐Ÿ“‹ Windows Shortcuts

Ctrl + Shift + 7 โ€” Apply outline border around selection.
Ctrl + Shift + _ (underscore) โ€” Remove all borders.
Ctrl + 1 โ€” Open Format Cells dialog for full border control.
Alt + H, B โ€” Open Borders dropdown from Home tab.
Alt + H, B, A โ€” Apply All Borders directly.

๐Ÿ“‹ Mac Shortcuts

Cmd + Option + 0 โ€” Apply outline border around selection.
Cmd + Option + Hyphen โ€” Remove all borders.
Cmd + 1 โ€” Open Format Cells dialog.
Cmd + Option + Down arrow โ€” Apply bottom border only.
Cmd + Option + Right arrow โ€” Apply right border only.

๐Ÿ“‹ Web (OneDrive)

Excel for the web has a reduced border toolset. Click Home tab, click Borders icon, pick from the dropdown. You get Outline, Inside, All Borders, top/bottom/left/right, and No Border. No custom line styles or drawing tools. For advanced borders, open the workbook in the desktop app first.

Border Setup Checklist for Polished Reports

Select the entire data range, not individual cells, before applying borders
Use thick or medium weight for the outside frame, thin for inside lines
Add a double line or thick bottom border to separate header rows
Choose gray (RGB 191,191,191) instead of black for less visual noise
Save the combination as a Cell Style for reuse across worksheets
Turn off gridline printing in Page Layout before sending to print
Apply borders after merging cells, never before
Test the layout in Print Preview to confirm border placement
Try the Excel Practice Test

Automation, Themes, and Print Output

Office Scripts is the newer alternative in Excel for the web and Microsoft 365. The TypeScript API is structured around ranges and format objects. Record an action with the Office Scripts recorder if the API feels overwhelming. The recorded code is verbose but it's a working starting point that you can then trim down and parameterize for any range or border combination. Combine recorded scripts with the Power Automate connector and you can apply borders to incoming files automatically before they reach a SharePoint folder.

Borders interact with cell merging in ways that surprise people. When you merge a range, Excel applies the borders of the top-left cell to the entire merged area. The other cells' borders are discarded. If you unmerge the cells later, the original borders do not come back. Always set merged-cell borders after merging, not before. If you're working with a layout that mixes merged headers and unmerged data, format the unmerged data first, then merge and reformat the header. This sequence prevents the disappearing-border problem completely.

Excel also has a Theme system that influences default colors, including border colors that reference theme positions. Pick a theme under Page Layout, Themes, and any border set to a theme color shifts automatically. This is powerful for branded workbooks because changing the theme updates every themed border, fill, and font in one click. To set a border to a theme color, open Format Cells, Borders, Color, and pick from the top row of theme colors rather than the standard color grid below. Standard colors stay fixed regardless of theme changes.

When you copy and paste between workbooks, borders sometimes shift in unexpected ways. Excel paste options include Keep Source Formatting, Match Destination Formatting, and a Values Only option that strips all formatting. If you want the borders to follow the data, pick Keep Source Formatting. If you want only the numbers and the destination's existing border scheme, pick Match Destination Formatting. Paste Special with Formats selected copies only formatting, including borders, without touching the values, which is useful for applying a known border layout to a new dataset.

Borders aren't just decoration. Used well, they make data easier to scan, easier to print, and easier to share. Used poorly, with every cell outlined in heavy black, they make a sheet look like a 1990s database printout. The sweet spot is light or no borders inside, a stronger frame around the whole table, a horizontal rule under headers, and an extra line above totals. Start with that pattern, build a cell style around it, and you'll never spend more than a few seconds on borders again. Now go format that report.

Print Preview is the single best feedback tool when you're working with borders. Press Ctrl + P to jump straight to it. The preview shows exactly which lines will land on paper, where pages break, and whether your outside frame survives the trip to the printer. If the right edge of your table disappears past the page boundary, return to the sheet, narrow a column or two, and check again. Borders that look fine on screen at 100 percent zoom can still spill if Excel decides to break a page mid-table.

Workbook templates are the final layer of border consistency for teams. Build a workbook with your standard borders applied to a sample table, save it as an Excel Template (.xltx) under File, Save As, and place it in the Custom Office Templates folder. Anyone who clicks New in Excel sees your template and starts from a sheet that already has the company's border scheme. Combine the template with cell styles and a couple of named ranges, and the formatting work for every future report drops from minutes to zero.

Quick Borders vs Custom Cell Styles

Pros

  • Quick borders apply in one click from the ribbon dropdown
  • Keyboard shortcuts make outline borders nearly instant
  • All Borders preset works on any data range
  • No setup needed for one-off formatting tasks

Cons

  • Quick borders force you to redo work on every new sheet
  • No way to mix thin and thick lines without Format Cells
  • Inconsistent results when team members use different presets
  • Cell styles take 30 seconds to build but save hours over time

Excel Questions and Answers

What is the keyboard shortcut to add borders in Excel?

Press Ctrl + Shift + 7 on Windows or Cmd + Option + 0 on Mac to apply an outline border to the selected range. To remove all borders, use Ctrl + Shift + _ (underscore) on Windows or Cmd + Option + Hyphen on Mac.

How do I add a thick border around a cell range?

Select the range, press Ctrl + 1 to open Format Cells, click the Borders tab, pick a thick line style from the Style list, then click the Outline preset. Click OK. The thick border will frame your range while leaving inside lines untouched.

Why don't my borders show up when printing?

You likely applied gridlines (the default light gray lines) instead of real borders. Gridlines don't print by default. Open Format Cells with Ctrl+1, click Borders, and apply actual border lines. Use Print Preview before printing to confirm the borders appear on the printed sheet.

How do I add a border around a selected cell only?

Click the single cell to select it. Click the Borders dropdown arrow on the Home tab. Choose Outside Borders. The cell now has a border on all four sides. To use a different style, press Ctrl+1, click Borders, pick your style, then click the four perimeter buttons in the preview.

Can I add diagonal borders in Excel?

Yes. Open Format Cells with Ctrl+1 and click Borders. The two buttons below the preview pane add diagonal lines, one running top-left to bottom-right and the other bottom-left to top-right. You can combine both for an X across the cell, useful for marking cells as not applicable.

How do I add borders to multiple cells at once?

Select the entire range first by clicking and dragging, or by typing the range like A1:G50 into the Name Box and pressing Enter. Then apply borders using the Home tab dropdown, Format Cells dialog, or keyboard shortcut. Excel applies the chosen border to the whole selection in one action.

How do I remove borders in Excel?

Select the cells with borders. Click the Borders dropdown on the Home tab and pick No Border, or press Ctrl + Shift + _ on Windows. To remove just one edge, open Format Cells with Ctrl+1, click Borders, and click the specific edge in the preview pane to toggle it off.

What's the difference between borders and gridlines?

Gridlines are display-only lines that appear around every cell on a blank worksheet. They don't print and they vanish under cell fills. Borders are actual cell formatting that prints, persists through fills, and can be styled with custom line types, weights, and colors. Always use borders for output that needs to look polished.

How do I save my border style for reuse?

Format a cell with the borders, fill, and font you want. On the Home tab, click Cell Styles, then New Cell Style. Name the style, click OK. It now appears in the gallery and applies to any cell with one click. Use Merge Styles to bring it into other workbooks.

โ–ถ Start Quiz