[FONT=lucida console][COLOR=Royalblue]Private[/COLOR] [COLOR=Royalblue]Const[/COLOR] SRA [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]String[/COLOR] = [COLOR=brown]"A2:E2"[/COLOR] [I][COLOR=seagreen]'address where you type the search criteria[/COLOR][/I]
[COLOR=Royalblue]Private[/COLOR] [COLOR=Royalblue]Const[/COLOR] dS [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR] = [COLOR=crimson]2[/COLOR] [I][COLOR=seagreen]'row where you type the search criteria[/COLOR][/I]
[COLOR=Royalblue]Private[/COLOR] [COLOR=Royalblue]Const[/COLOR] dr [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR] = [COLOR=crimson]4[/COLOR] [I][COLOR=seagreen]'First row of data (exclude header)[/COLOR][/I]
[COLOR=Royalblue]Private[/COLOR] [COLOR=Royalblue]Sub[/COLOR] Worksheet_Change([COLOR=Royalblue]ByVal[/COLOR] Target [COLOR=Royalblue]As[/COLOR] Range)
[COLOR=Royalblue]Dim[/COLOR] i [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR], j [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR], n [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR]
[COLOR=Royalblue]Dim[/COLOR] m [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR], p [COLOR=Royalblue]As[/COLOR] [COLOR=Royalblue]Long[/COLOR]
[COLOR=Royalblue]Dim[/COLOR] r [COLOR=Royalblue]As[/COLOR] Range
[COLOR=Royalblue]Dim[/COLOR] arr, z, x
[COLOR=Royalblue]If[/COLOR] [COLOR=Royalblue]Not[/COLOR] Intersect(Target, Range(SRA)) [COLOR=Royalblue]Is[/COLOR] [COLOR=Royalblue]Nothing[/COLOR] [COLOR=Royalblue]Then[/COLOR]
n = Range(SRA).Resize([COLOR=crimson]100000[/COLOR]).Find([COLOR=brown]"*"[/COLOR], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Application.ScreenUpdating = [COLOR=Royalblue]False[/COLOR]
Range([COLOR=brown]"A"[/COLOR] & dr & [COLOR=brown]":A"[/COLOR] & n).EntireRow.Hidden = [COLOR=Royalblue]False[/COLOR]
[COLOR=Royalblue]If[/COLOR] WorksheetFunction.CountA(Range(SRA)) > [COLOR=crimson]0[/COLOR] [COLOR=Royalblue]Then[/COLOR]
Rows(dS).AutoFit
[COLOR=Royalblue]For[/COLOR] [COLOR=Royalblue]Each[/COLOR] r [COLOR=Royalblue]In[/COLOR] Range(SRA)
j = r.Column
[COLOR=Royalblue]If[/COLOR] Len(Cells(dS, j)) > [COLOR=crimson]0[/COLOR] [COLOR=Royalblue]Then[/COLOR]
arr = Split(Cells(dS, j), [COLOR=brown]","[/COLOR])
[COLOR=Royalblue]For[/COLOR] i = dr [COLOR=Royalblue]To[/COLOR] n
z = Cells(i, j)
[COLOR=Royalblue]If[/COLOR] z = [COLOR=brown]""[/COLOR] [COLOR=Royalblue]Then[/COLOR] Rows(i).EntireRow.Hidden = [COLOR=Royalblue]True[/COLOR]
[COLOR=Royalblue]If[/COLOR] Rows(i).RowHeight > [COLOR=crimson]0[/COLOR] [COLOR=Royalblue]Then[/COLOR]
m = [COLOR=crimson]0[/COLOR]
[COLOR=Royalblue]For[/COLOR] [COLOR=Royalblue]Each[/COLOR] x [COLOR=Royalblue]In[/COLOR] arr
m = m + InStr([COLOR=crimson]1[/COLOR], z, x, [COLOR=crimson]1[/COLOR])
[COLOR=Royalblue]If[/COLOR] m > [COLOR=crimson]0[/COLOR] [COLOR=Royalblue]Then[/COLOR] [COLOR=Royalblue]Exit[/COLOR] [COLOR=Royalblue]For[/COLOR]
[COLOR=Royalblue]Next[/COLOR]
[COLOR=Royalblue]If[/COLOR] m = [COLOR=crimson]0[/COLOR] [COLOR=Royalblue]Then[/COLOR] Rows(i).EntireRow.Hidden = [COLOR=Royalblue]True[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]If[/COLOR]
[COLOR=Royalblue]Next[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]If[/COLOR]
[COLOR=Royalblue]Next[/COLOR]
[COLOR=Royalblue]Else[/COLOR]
Rows(dS).RowHeight = [COLOR=crimson]35[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]If[/COLOR]
Application.ScreenUpdating = [COLOR=Royalblue]True[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]If[/COLOR]
[COLOR=Royalblue]On[/COLOR] [COLOR=Royalblue]Error[/COLOR] [COLOR=Royalblue]Resume[/COLOR] [COLOR=Royalblue]Next[/COLOR]
p = Range([COLOR=brown]"A"[/COLOR] & dr & [COLOR=brown]":A"[/COLOR] & n).SpecialCells(xlCellTypeVisible).Cells.Count
Application.StatusBar = [COLOR=brown]"Found "[/COLOR] & p & [COLOR=brown]" rows"[/COLOR]
[COLOR=Royalblue]On[/COLOR] [COLOR=Royalblue]Error[/COLOR] [COLOR=Royalblue]GoTo[/COLOR] [COLOR=crimson]0[/COLOR]
[COLOR=Royalblue]End[/COLOR] [COLOR=Royalblue]Sub[/COLOR][/FONT]