Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

Quickly hide rows with #N/A or other specific error values in Excel

Author Sun Last modified

This article provides methods to quickly hide or display only rows containing #N/A errors or other specific errors in Excel.


Hide rows with #N/A or other specific error values by VBA code

Excel does not have a built-in function for this, but here is a VBA code that can help you handle this task quickly.

1. Right click at the sheet tab which contains the #N/A errors you want to hide, then select View Code.
A screenshot showing the View Code option from the sheet tab context menu in Excel

2. Then copy and paste below code to the blank script in the popping Microsoft Visual Basic for Applications window.

VBA: Hide #N/A error rows

Private Sub EnableErrorRow()
'UpdatebyExtendoffice
Dim xWs As Worksheet
Dim xRg As Range
Dim xERg As Range
Dim xEERg As Range
Dim xFNum As Integer
Dim xSreE As String
xSreE = "#N/A"
Set xWs = Application.ActiveSheet
Application.ScreenUpdating = False
On Error Resume Next
    With xWs
        Set xRg = .UsedRange
        For xFNum = 1 To xRg.Columns.Count
            Set xERg = .Columns(xFNum).SpecialCells(xlCellTypeFormulas, xlErrors)
             xERg.Select
             If (Not TypeName(xERg) = "Nothing") Then
             For Each xEERg In xERg
             
             If (xEERg.Text = xSreE) Then
                xEERg.EntireRow.Hidden = True
             End If
             Next
             End If
        Next xFNum
    End With
Application.ScreenUpdating = True
End Sub

A screenshot showing VBA code pasted in the Microsoft Visual Basic for Applications window

3. Press F5 key, then all rows containing #N/A errors will be hidden.
A screenshot showing rows with #N/A errors hidden after running VBA code

Note: you can change #N/A to other error you want to hide in the VBA.

Tip: If you want to unhide all ranges, you can try Kutools for Excel’s Unhide All Range utility. Free Download Kutools for Excel.
A screenshot of the Unhide All Range utility in Kutools tab in Excel


Only display rows with #N/A or other specific error values by Kutools for Excel

The Super Filter utility of Kutools for Excel allows you to filter specific error values and display only rows with #N/A errors.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the data range you use (you’d select including header), and click Kutools Plus > Super Filter to display the Super Filter pane.
A screenshot showing the Super Filter option in Kutools tab in Excel

2. Choose the filter criteria as below screenshot shown:

1) Select the column header you use to filter;

2) Select Error, Equals and #N/A successively in following drop down lists.
A screenshot showing filter criteria selection in the Super Filter pane

3. Click Ok > Filter, then only the rows with #N/A error value have been displayed.
A screenshot showing only rows with #N/A error displayed after using the Super Filter

With Super Filter, you can filter date/year/month/quarter/text format. Click here to learn more about the Super Filter tool.
An animated demonstration of filtering rows with errors using Kutools

If the Super Filter cannot gratify you, the Special Filter utility of Kutools for Excel provides some special options for you.
A screenshot showing the Special Filter utility in Kutools for Excel


Other Operations (Articles) Related To filtering

Filter data based on a list
This tutorial provides tricks on filtering data based on a given list data in Excel.

Filter data contains asterisk
As we know, we use asterisk mask to stand any characters when you filter data, but how can you do if you want to filter data which contains asterisk mask? Now this article introduces the method about data filtering if containing asterisk or other special characters in Excel.

Filter data with criteria or wildcard
If you want to filter data with multiple criteria, how can you do? This tutorial is talking about how to set multiple criteria and filter data in Excel.

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in