YJL said:
.. where should i get started? Where should i put your code into? ...
Just some implementation assist to illustrate how to get Peo's subs
operational ..
Sample implementation at:
http://cjoint.com/?lohmdZtMUz
Pullout_related_rows_that_match_a_single_word_using_Vlookup_YJL_misc.xls
(Note: Save the file to folder and then open from there. It may not work
properly if opened within the browser window.)
In Excel,
Press Alt+F11 to go to VBE
Click Insert > Module
Paste Peo's 2 subs: Test_Me & Reset_Filter (below)
into the code window on the right
Press Alt+Q to get back to Excel
In Excel, draw a button from the Forms Toolbar on the sheet
(If reqd, activate the forms toolbar via View > Toolbars > Forms)
In the Assign Macro dialog, select Test_Me, click OK
Change the button caption to say: Search
Draw another button, select Reset_Filter, click OK (caption change to:
Clear)
(You can always right-click on the button to get back to the dialog, if
required)
Move and position the 2 buttons within say, row1 (expand the row height
first)
Select A2, then click Window > Freeze pane
This will freeze the pane so that row1 always remain in view when you scroll
down
Now test it out ...
Click Search button > Type in the inputbox, say: YJL > OK
The filtered results will show in the sheet
Click Clear button > The whole table will be re-displayed in the sheet
'-----------
Sub Test_Me()
Application.ScreenUpdating = False
UserVal = Application.InputBox("Enter Search String")
If UserVal = False Then
Exit Sub
Else
Selection.AutoFilter Field:=1, Criteria1:="*" & UserVal & "*"
End If
Application.ScreenUpdating = True
End Sub
'---------
'----------
Sub Reset_Filter()
Application.ScreenUpdating = False
For Each sh In Worksheets
If sh.FilterMode Then
On Error Resume Next
sh.ShowAllData
End If
Next
Range("A1").Select
Application.ScreenUpdating = True
End Sub
'-----------