search and filter results macro

S

SearchandDeliver

My problem is that i have a worksheet with a number of text columns; i wish
to search one of the colomns (colomn H) and filter (the entire row) in
results.

I know i can use a filter; but for ease of use with non excel litterate
people i would like to use a macro where they need to enter the criteria into
a cell; and link the search criteria to that cell such as (H14).

Your help is much appreciated
 
G

Gord Dibben

Instead of them typing into a cell you could use an InputBox

Option Compare Text
Sub Filter_Stuff()
Dim whatwant As String
whatwant = InputBox("Enter criteria.")
Range("H1").Select
With ActiveSheet.UsedRange
Selection.AutoFilter
Selection.AutoFilter Field:=1, _
Criteria1:=whatwant, Operator:=xlAnd
End With
End Sub

Assign to a button for users to to click on.


Gord Dibben MS Excel MVP
 
Top