How to create a button to filter?

roberts3344

New Member
Joined
Mar 20, 2009
Messages
1
I have a list of different numbers in a column and a description of what the number is in the next column. Im trying to creat a button where someone can click and have something popup to allow them to type in a number and have it filter to that number and description. I dont want them to be able to do anything else besides click and type and search and view the result. They cant have access to be able to use the normal filter function. Is this possible?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Welcome to the Board!

You can record a macro applying the filter you want. In the resulting code you can replace the criteria with a variable, something like this:

Dim myCriteria As Long
myCriteria = Application.InputBox("Please enter your filter #", "Filter #", 1, Type:=1)

ActiveSheet.Range("$A$1:$B$7").AutoFilter Field:=1, Criteria1:=myCriteria, Operator:=xlFilterValues


Hope that helps,
 
Upvote 0
Hiya roberts3344,

I cannot believe that I am offering advice! :LOL:

I have recently done what I think you are after.

I will assume that your data is in Column A (1) the numbers,
and column B (2) the description.

1. Highlight the columns and rows that contain your data.
2. In the Namebox, give your sheet a name, eg "search".
3. Choose a cell that you want to type in the number to search, eg E10
4. Select a cell that you want the result of the search to appear, eg E11.
5. In the formula bar type/copy this.. =VLOOKUP(E10,search,2,false)

In E10 type in the number that you want to search, press enter.
In E11 the result for the number that you typed in should appear.

I hope that this is what you are after and that it works for you. ;)

Ak
 
Upvote 0
advanced filters are good for this

work out the filter you want to use then just make a macro to run it

i did that and it only takes a few minutes!!
 
Upvote 0
This may already be part of Excel.
1. add or ensure the "Filter Icon" is available
2. click on the data item that you want to filter on.
3. click on the filter icon
4. Clear the filter by clicking on the "ShowAll" icon

Look at Tools | Customize | Commands to add the icons.
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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