Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Create a filter in excel sheet

Hi,

I want to create a filter in excel sheet.
After the header on the 1st row.Need to have a space where i can type any text and click enter and only the select data's row will be displayed.

regards
Sharath
Avatar of Brian Pierce
Brian Pierce
Flag of United Kingdom of Great Britain and Northern Ireland image

Will an Autofilter do?
Select Data->Autofilter

A drop doen box will appear on the header row titles. You can then use this to select data. See http://www.contextures.com/xlautofilter01.html
Avatar of bsharath

ASKER

No i need a way to type the data and then it gets filtered..In the Row 2 i should have space to enter text.
sharath this question belongs to excel zone,
Sorry....
you can use the following macro
Sub a()
Worksheets("Sheet1").Range("A1").AutoFilter _
    field:=1, _
    Criteria1:=Sheet1.Cells(2, 1) ' type your text in Sheet1.Cells(2,1)

End Sub
Hitesh i think you got confused.

I need a box between the header and the content.So that when i type "Sharath" it seaches sharath in the colum and displays only the sharath and the other rows of sharath
1 Header
2. Blank box (Here i should be able to type some content
3. Subjects (Content)
you can use the contol TextBox which is present in the Excel Control ToolBox (search it in the bar on the top of the workbook), drag one textbox on the Sheet and use the following code.

Remember Sheet1 is your sheetname

Sub a()
Worksheets("Sheet1").Range("A1").AutoFilter _
    field:=1, _
    Criteria1:=Sheet1.TextBox1.Text  ' type your text in Sheet1.Cells(2,1)

End Sub




ASKER CERTIFIED SOLUTION
Avatar of Hitesh Manglani
Hitesh Manglani
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am using excel 2007 .Where can i find this option
just check it must be somewhere  in the excel workbook
here is the link, you have to click developer tab and click insert
http://www.kbalertz.com/Q291073/Forms.Controls.Worksheet.aspx