Learning how to remove lines in Excel is one of those deceptively simple skills that separates polished spreadsheets from messy ones. The phrase covers several very different operations: deleting blank rows that bloat your data, hiding the default gridlines that print on every sheet, clearing manual borders someone applied years ago, removing dashed page break lines that clutter your view, and stripping underlines from text inside cells. Each requires a slightly different click path, and confusing them is the most common reason spreadsheets look unprofessional even after hours of formatting work.
The most frequent request is deleting blank or duplicate rows that appear when you import data from a CSV, a database export, or a copy-paste from a web page. Excel does not automatically compact your data, so empty rows sit between records and break formulas like SUMIFS, COUNTIFS, and especially VLOOKUP, which stops scanning at the first empty cell in many lookup configurations. Removing these rows tightens your dataset and makes filtering, sorting, and pivoting reliable again.
Gridlines are the second category. Those faint gray lines you see between cells are a viewing aid, not a real border. They print by default in older versions and disappear by default in newer ones, which causes endless confusion when a workbook moves between machines. Knowing how to toggle them on the View tab versus the Page Layout tab determines whether your printed report looks like a finished document or a draft worksheet.
Borders are the third category and the trickiest. Unlike gridlines, borders are applied per cell and persist in the file. A workbook can have dozens of overlapping border styles inherited from old templates, pasted ranges, and conditional formatting rules. Clearing them requires understanding the difference between No Border, Clear Formats, and removing the cell style entirely. Get this wrong and you delete your number formatting along with the lines.
Page break lines, those dashed blue or solid lines that appear after you preview a print job, are the fourth category. They are not part of your data but they refuse to disappear without a specific reset. Many users assume the file is corrupted when really they just need to clear manual breaks from the Page Layout ribbon.
Finally, there are underlines inside cells, struck-through text, and lines from drawing objects or shapes that someone added on top of the grid. Each has its own removal path. This guide walks through every type of line you might encounter, when to use which method, and how to avoid the formatting accidents that come with bulk cleanup. Whether you are preparing a board report, cleaning an import file, or just trying to make a tracker readable, you will find the exact steps below.
If you work in Excel daily, mastering these cleanup operations pays for itself within a week. A clean sheet runs faster, prints predictably, and plays nicely with pivot tables and Power Query. By the end of this guide you will know which lines to remove, which to keep, and how to do it in two clicks instead of twenty.
Empty rows scattered through imported data. Removed with Filter, Go To Special > Blanks, or Power Query. Affects formulas like VLOOKUP and breaks pivot table source ranges if left in place.
The faint default lines separating cells. Toggle off under View > Show > Gridlines for screen, or Page Layout > Gridlines > Print uncheck for printed output. They are display-only and not saved as cell formatting.
Manually applied lines that persist in the file. Remove via Home > Borders dropdown > No Border, or with Clear Formats. Borders survive copy-paste and travel with the cell unless explicitly cleared.
Dashed or solid lines showing print boundaries. Reset under Page Layout > Breaks > Reset All Page Breaks. Manual breaks need explicit removal; automatic breaks adjust with margins and scale settings.
Text underlines from font formatting and drawn lines from Insert > Shapes. Remove font lines with Ctrl+U or the Underline button; delete shapes by selecting them with F5 > Special > Objects and pressing Delete.
Deleting blank rows is the most common reason people search for how to remove lines in Excel, and there are four reliable methods depending on the size of your dataset and how the blanks are distributed. The fastest approach for small to medium sheets is the Go To Special technique. Select your data range, press F5 or Ctrl+G to open the Go To dialog, click Special, then choose Blanks and press OK. Excel highlights every empty cell in the selection. Right-click any highlighted cell, choose Delete, then Entire Row, and your blanks vanish in one step.
For larger datasets where Go To Special might catch cells you want to keep, the Filter method is safer. Apply AutoFilter to your headers, click the dropdown on a column that should always contain data, uncheck Select All, then check only Blanks. Excel hides every other row, leaving just the empties visible. Select those visible rows, right-click, and delete. Remove the filter and your good data returns intact. This method is the workhorse for cleaning exports from accounting systems and CRM tools where stray blank rows mark section breaks.
A third approach uses Excel's Sort function. Select your data including headers, go to Data > Sort, and sort by your primary column ascending. Blank rows fall to the bottom of the dataset where you can select and delete them in one block. This works beautifully when you don't need to preserve the original row order, such as when you plan to re-sort by date or category afterward anyway.
Power Query, available in Excel 2016 and later, is the heavyweight option for repeated imports. Load your data into Power Query through Data > Get Data, then use Home > Remove Rows > Remove Blank Rows. The query remembers the step, so every refresh automatically strips blanks from new data. This is the right tool when you receive the same messy report weekly and want a permanent solution rather than a manual cleanup ritual.
Duplicate rows are a related cleanup task often handled at the same time. Select your range, go to Data > Remove Duplicates, choose which columns define a duplicate, and click OK. Excel keeps the first occurrence and deletes the rest, reporting how many it removed. Combine this with blank row removal for a thorough cleanup of imported data.
When deleting rows, always work on a copy of your data first, especially if the file contains formulas that reference specific row numbers. Deleting rows shifts everything below upward and can break absolute references like $A$47 that suddenly point to different data. Save before you start, and use Ctrl+Z aggressively if anything looks wrong. For a related technique that helps you isolate which rows need deletion, see our guide on how to add a filter in Excel.
One final tip: if you need to learn how to freeze a row in Excel before scrolling through a huge dataset to spot blanks visually, freeze the header row first under View > Freeze Panes > Freeze Top Row. This keeps your column labels visible while you scan, making it far easier to confirm you are deleting the right rows.
Gridlines are the light gray lines that separate cells by default. They are a viewing aid, not a saved property of the cell. To toggle them on screen, go to View > Show and uncheck Gridlines. The entire sheet becomes a clean white canvas, which is ideal for dashboards, invoices, and reports where you want a polished look.
To stop gridlines from printing, go to Page Layout > Sheet Options > Gridlines and uncheck Print. The two toggles are independent, so you can see gridlines while editing but produce a clean printout. Gridline color can also be changed under File > Options > Advanced > Display options, useful for accessibility.
Borders are actual cell formatting applied through Home > Borders or the Format Cells dialog. Unlike gridlines, they print regardless of the gridline setting and travel with the cell when copied. To remove them, select the affected cells, click the Borders dropdown in the Home tab, and choose No Border. The border icon shows the last-used style, so always click the dropdown arrow.
If borders persist after clicking No Border, you may have multiple overlapping border styles or conditional formatting applying lines. Use Home > Clear > Clear Formats as a nuclear option, but be aware this strips number formats, fonts, and colors too. For surgical border removal, use the Erase Border tool from the Borders dropdown.
Page break lines appear after you open Print Preview or switch to Page Break Preview. Dashed lines are automatic breaks Excel calculates from your paper size and margins. Solid blue lines are manual breaks you or someone else inserted. To remove a single manual break, click a cell below or right of the break and go to Page Layout > Breaks > Remove Page Break.
To clear every manual break in the worksheet at once, go to Page Layout > Breaks > Reset All Page Breaks. The dashed automatic lines remain because they are calculated, not stored. To hide them entirely, switch back to Normal view under View > Workbook Views > Normal, then go to File > Options > Advanced and uncheck Show page breaks.
Press F5, click Special, choose Blanks, then right-click and pick Delete Entire Row. This three-step sequence removes thousands of blank rows in under thirty seconds and is the single most useful keyboard shortcut for cleaning imported data. Always select only your data range first to avoid deleting blank rows in unrelated areas of the sheet.
Once you have the basics down, several advanced techniques speed up line removal across multiple sheets or recurring imports. The first is recording a macro. Turn on macro recording under View > Macros > Record Macro, perform your cleanup steps once, and stop recording. Excel generates VBA code that replays the entire process with one click. For workbooks you clean weekly, this turns a ten-minute task into a one-second button press. Save the macro to your Personal Macro Workbook so it is available in every file you open.
A simple VBA snippet to delete all blank rows in the used range looks like this: On Error Resume Next, then ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).EntireRow.Delete. Paste this into a module via Alt+F11, and you have a reusable cleanup tool. Add a second line to remove duplicates: ActiveSheet.UsedRange.RemoveDuplicates Columns:=Array(1,2,3), Header:=xlYes. Adjust the column array to match the fields that define a duplicate in your data.
Power Query is the modern alternative for users who avoid VBA. Load your raw data through Data > Get Data > From File or From Table, then in the Power Query Editor use Home > Remove Rows > Remove Blank Rows, followed by Home > Remove Rows > Remove Duplicates. Close and Load returns clean data to your sheet. Every time you click Refresh, the same cleanup runs automatically. This is ideal for monthly financial closes where the source file always arrives with the same garbage rows in the same places.
For removing borders across multiple sheets at once, group the sheets by Ctrl-clicking each tab, then apply No Border to your selection on the active sheet. The change replicates across all grouped sheets simultaneously. Remember to ungroup by right-clicking a tab and choosing Ungroup Sheets when finished, or further edits will affect every sheet in the group, which is rarely what you want.
Conditional formatting can also create lines that look permanent but are actually rule-driven. Check Home > Conditional Formatting > Manage Rules to see if any active rules apply borders. Delete the rules you no longer want. This is a common hidden source of borders that won't go away no matter how many times you click No Border, because the conditional rule re-applies the format after every change.
Finally, drawn shapes and lines added through Insert > Shapes can mimic cell borders. Press F5, click Special, choose Objects, and press OK to select every shape and line on the sheet. Press Delete to remove them all at once. This trick is invaluable when inheriting a workbook full of arrows, dividers, and signature lines that someone added years ago and nobody remembers why.
Combining these advanced techniques with the basic methods covered earlier lets you handle any line-removal scenario in Excel. For users who frequently combine cells while cleaning sheets, understanding how to merge cells in Excel pairs well with these techniques since merged cells can complicate row deletion and need separate handling.
Even experienced users make predictable mistakes when removing lines in Excel. The most common is confusing gridlines with borders. Turning off View > Gridlines hides the default lines, but any cell that has a real border still shows its border. Users then assume the toggle is broken when really they need to clear the borders separately. Always check both: hide gridlines first, then inspect for stray borders by selecting all cells with Ctrl+A and applying No Border.
The second mistake is deleting rows that participate in named ranges or table objects. Excel tables expand and contract automatically when you delete rows, but named ranges defined with absolute references do not. After bulk deletion, open Formulas > Name Manager and check for broken references. Repair them before saving, or downstream formulas like SUMIFS and the venerable VLOOKUP will start returning errors or wrong values that are hard to trace later.
A third pitfall is removing duplicates before sorting your data. Excel's Remove Duplicates keeps the first occurrence and discards the rest, so if your data is in random order, you may keep the wrong record. Sort by your timestamp or priority column first, then remove duplicates. This ensures the version you keep is the most recent or highest-priority record, not a random first appearance.
Page break lines cause endless frustration because they refuse to disappear from the Normal view in some Excel versions even after resetting all breaks. The fix is in File > Options > Advanced under Display options for this worksheet: uncheck Show page breaks. This is a per-sheet setting, so you may need to repeat it on each tab of your workbook. Save and reopen the file; the dashed lines should be gone for good.
Another underappreciated issue is borders that come back after pasting. When you copy a range with borders into a freshly cleared area, the borders ride along with the values. Use Paste Special > Values to bring in just the data without formatting. This single habit prevents 90 percent of the border accumulation that makes workbooks look chaotic over time. Build it into your muscle memory and your spreadsheets will stay clean by default.
Finally, beware of strikethrough and underline formatting inside cells, which look like horizontal lines through text. These are font effects, not borders. Select the cells, open Format Cells with Ctrl+1, go to the Font tab, and uncheck Strikethrough and Underline. Alternatively, press Ctrl+U to toggle underline directly. Mixing up these font effects with cell borders sends users down the wrong cleanup path for minutes at a time.
For more on cleanup techniques that pair with line removal, our guide on how to create a drop down list in excel covers data validation, which can replace messy free-text entries that often arrive with weird formatting attached.
To put everything together, here is the practical workflow seasoned Excel users follow when they inherit a messy workbook and need to clean it up fast. Start with a save-as to create a working copy, leaving the original untouched. This single habit has saved countless hours of recovery work over the years. Name the copy something obvious like FileName_CLEANUP_2026-05-20 so you can find it later and so colleagues understand which version is the safe one to edit.
Next, open the file and immediately go to the Name Manager to inventory named ranges, then check Formulas > Show Formulas to see what depends on what. Take a screenshot or note the totals of key columns. This baseline lets you verify after cleanup that nothing important changed. Auditors and analysts especially benefit from this discipline because they often need to defend their cleanup decisions later.
Now tackle structural cleanup in order: blank rows first, duplicates second, then borders, then gridlines, then page breaks. Each step builds on the previous. Removing duplicates before blanks can leave you with paired empty rows. Clearing borders before deleting rows is wasted effort because the deletion shifts the borders anyway. Follow the sequence and the cleanup goes smoothly with minimal backtracking.
When you reach the visual cleanup stage, decide whether the workbook is for screen viewing, printing, or both. Screen-only workbooks benefit from hiding gridlines and using selective borders to highlight totals and headers. Print-focused workbooks need printed gridlines on or carefully designed borders, plus deliberate page break placement so reports paginate cleanly. Trying to optimize for both at once usually produces a compromise that looks bad either way.
For recurring cleanup tasks, invest fifteen minutes in either a macro or a Power Query routine. The time pays back within two refresh cycles. Document the routine in a comment cell on the first tab so future users know it exists. Spreadsheets outlive their creators in most organizations, and a small comment explaining the cleanup process is the gift of an hour to whoever inherits the file next.
Finally, build the habit of paste-special-values whenever you bring data in from another source. Most line accumulation in spreadsheets comes from copy-paste operations that drag formatting along. By stripping formatting at the door, you prevent the mess rather than cleaning it up later. Combined with the techniques in this guide, this single habit will keep your workbooks looking professional indefinitely with almost no ongoing effort.
Cleanup is not glamorous, but it is the foundation of trustworthy analysis. A clean sheet runs faster, prints predictably, and produces formulas you can rely on. Master the line-removal techniques here and you will produce work that stands out in any office, simply because it looks finished.