How to hide #N/A error values

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
611
Office Version
  1. 2019
Platform
  1. Windows
I have a worksheet with several #N/A error values. How can I hide rows that contain the #N/A errors. Thank you for your help.

Sean
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
you can change the formula that causes the error or perhaps create a conditional format that you make it formulais
=ISNA(K5)
format with font color white
change the cell reference to your cell
 

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
611
Office Version
  1. 2019
Platform
  1. Windows
Thank you, but changing cell format leaves too many white cells, and changing cell reference would not be feasible. It's best to just hide the entire row for every #N/A value in column B. Is that possible?

Sean
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458

ADVERTISEMENT

you could create a filter for the #N/A, then select the #N/A and hide row

otherwise you would need some VB
 

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
611
Office Version
  1. 2019
Platform
  1. Windows
could someone post VB codes? I have zero knowledge of VB.


Sean
 

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
611
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

The code below hides rows with zero values (got coded from internet). How can I make the code unhide hidden rows. Thanks your help.


Sub HideRows()

Dim c
Application.ScreenUpdating = False

With Worksheets("INCOME STATEMENT").Range("b6:b752")
.EntireRow.Hidden = False
End With

For Each c In Worksheets("INCOME STATEMENT").Range("b6:b752")
If c.Value = 0 Then

c.EntireRow.Hidden = True
End If
Next c

ActiveSheet.DisplayAutomaticPageBreaks = False
Application.ScreenUpdating = True


End Sub
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
this part unhides the rows

Code:
With ActiveSheet.Range("b6:b752")
       .EntireRow.Hidden = False
End With
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
You don't need VBA, as texaslynn said, you can use the autofilter.
when you click the filter dropdown, choose custom - does not equal - #N/A
 

Forum statistics

Threads
1,144,370
Messages
5,723,960
Members
422,529
Latest member
mbilal429

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top