
Originally Posted by
excelliot
Ok, what you can do is put this code in sheet in which you want to hide rows automatically..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("B1:B1000")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
If UCase(Target.Value) = "#N/A" Then
cell.EntireRow.Hidden = True
End If
End Sub
you can change range to specific range where you will get #N/A
Cheers!!
I tried to do the same but hide everything but a single value
So I changed the code like follows, but it doesn't seem to work
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("B3:K500")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
If UCase(Target.Value) = "#N/A" Then
cell.EntireRow.Hidden = False
Else: cell.EntireRow.Hidden = True
End If
End Sub
Bookmarks