Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to only delete visible rows or columns in Excel?

In Excel, we usually hide some important rows or columns of information, sometimes, we need to delete the visible rows or columns only, if you delete them with Delete key directly, the hidden values will be deleted at the same time. How do you delete the visible rows or columns without deleting the hidden rows or columns in Excel? This tutorial will introduce the ways to delete visible rows only.

Delete visible values only with Go To Special command

Delete visible values only with VBA code

Delete visible rows only with Kutools for Excel


Batch delete blank/visible/hidden rows or columns in Excel

You can delete visible, hidden or blank rows in Excel by selecting them one by one then press Delete key to remove them, but if there are hundreds of rows needed to be removed, the Delete Hidden (Visible) Rows & Columns in Kutools for Excel will do you a favor. With this tool, you can remove blank rows (columns), visible rows (columns), or hidden rows (columns) in selected range, active sheet, selected sheets or whole workbook. Click here for 60-day free trial of this tool.

delete visible rows

arrow blue right bubble Delete visible values only with Go To Special command


With this Go To Special command in Excel, you can quickly select the visible values and then delete them with Delete key. Do as this:

1. Select the range that you want to delete the visible data.

2. Click Home > Find & Select > Go To Special, see screenshot:

3. In the Go To Special dialog box, select Visible cells only, see screenshot:

4. Then click OK, all the visible rows have been selected in the selected range.

5. Then press Delete key on the keyboard, the selected visible values will be deleted and the hidden values will be kept. See screenshots:

-1

Note:

1.In this way, you can also remove the visible column values, see screenshots:


arrow blue right bubble Delete visible values only with VBA code

The following VBA code also can help you to remove the visible cell values only in Excel.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

3. Then press F5 key or to run the code, and the visible cell values have been removed with the hidden values remaining.

4. Then a dialog will be displayed for you to select a range to deletd the visible cells only .

Sub DeleteVisibleRows()
'Update 20130906
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
WorkRng.SpecialCells(xlCellTypeVisible).ClearContents
Application.ScreenUpdating = True
End Sub

arrow blue right bubble Delete visible rows only with Kutools for Excel

The above two methods only can remove the visible values, but not the entire rows, if you have the Kutools for Excel, its Delete Rows & Columns function can help you quickly delete the visible entire rows or columns.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Select the range that you want to apply this tool.

2. Click Kutools > Delete > Delete Hidden (Visible) Rows & Columns, see screenshot:

doc delete visible rows 6

3. In the Delete Rows & Columns dialog box, choose In Select Range from the Look in, then specify the Rows and Visible rows from the Delete type and Detailed type separately. Click OK, and the prompt box will remind you how many visible rows have been deleted. See screenshot:

4. Then click OK, all the visible rows in the selected range have been deleted and the hidden rows are kept. See screenshots:

Notes:
1. You can delete the visible rows or columns from the selected range, selected sheets, active sheet or all sheets under the Look in option.

2. With this function, you also can only delete hidden rows or columns, blank rows or columns.

Please click Delete Rows & Columns to know about this feature.


Related articles:

How to remove blank or empty rows in Excel?

How to delete all hidden rows or columns in Excel?


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Lizzy · 5 months ago
    But this method deletes the handles (row 1) as well, which isn't what I want.
  • To post as a guest, your comment is unpublished.
    John · 2 years ago
    Didn't delete the rows, simply made them blank
  • To post as a guest, your comment is unpublished.
    Ashsh · 5 years ago
    thank you very much for the post :-)
  • To post as a guest, your comment is unpublished.
    Anupma · 5 years ago
    Hi,
    I have faced the same issue in 2007, I tried folowing way it worked:
    1. Keep the cursor on header cell eg, I wanted to filter by Product Name so I kept my cursor in Product Name Header.
    2. Click on Data>Filter
    3.Select Rows Number at Left most
    4. Right Click> Delete Rows

    Note: If only Delete option is displayed then it will delete hidden rows also, Try and follow steps again the option should be 'Delete Rows'
    :-)
    Good Luck