Autofilter search help

watergirl

New Member
Joined
Dec 27, 2010
Messages
1
I've got a database and I want people to be able to type in their initials and have only the rows that apply to that person remain. This is what I have so far:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Range("a2") = "" Then
Worksheets("Proposed").AutoFilterMode = False
Else
If Not ActiveSheet.AutoFilterMode Then
ActiveSheet.Range("a2:m40000").AutoFilter
End If
Selection.AutoFilter Field:=3, Criteria1:="*" & Range("a2").Value & "*"
End If

End Sub

The cell where the employee will be typing their initials is A2 and I need it to at least search the columns A, B, C, L, M, and N. It should then display the entire row where the initials were found. I've got it where I can do that, but with only one row. I have been trying to play around with the Field in the Selection.Autofilter to add fields, but have had no luck.

Thanks!
 

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

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

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
Back
Top