search and filter results macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top