Sub Verbergen_regels_met_0()
'Hides all rows with a certain value in column Y.
Dim vFind
Dim rSearch As Range
On Error GoTo ErrorHandle
'We ask for a search string. "?" and "*" in the search string
'will work as wildcards/"jokers".
vFind = InputBox("What to search for?")
If Len(vFind) = 0 Then Exit Sub
Application.ScreenUpdating = False
'In this example we search column B only.
'If you want to search the entire worksheet, you write
'e.g. "With ActiveSheet" or "With Worksheets(nb. or name)".
'You can also define another range than column Y.
Worksheets(Array("I_400", "E_410")).Select
With Columns("Y:Y")
Set rSearch = .Find(vFind, LookIn:=xlValues)
'If found:
If Not rSearch Is Nothing Then
'hide the row.
rSearch.EntireRow.Hidden = True
'Now we start a loop that finds all other
'instances. Instances in hidden row are
'not found by the search.
Do
Set rSearch = .FindNext(rSearch)
If Not rSearch Is Nothing Then
'If the search result isn't
'nothing, we hide the row.
rSearch.EntireRow.Hidden = True
Else
'If rSearch was indeed = Nothing, there was
'no instances and we exit the loop.
Exit Do
End If
Loop
End If
End With
BeforeExit:
Set rSearch = Nothing
Application.ScreenUpdating = True
Exit Sub
ErrorHandle:
MsgBox Err.Description & " Procedure FindHide"
Resume BeforeExit
Sheets("Progress summary internal").Select
End Sub