Attempting to display only certain records related to user criteria input

  • Thread starter Thread starter jlstai
  • Start date Start date
J

jlstai

I have an Excel spreadsheet with 100 records. Each record contains
columns of information with one of those columns being age. What
would like to do is have the user fill in a cell at the top of the pag
and then have only those records meeting that criteria be displayed.
For example, "Show records where age exceeds ____". If the user input
34 in the blank, then only those records where the value in the ag
column exceeds 34 would be displayed. If the user then changes thei
input to 15, then only those records where the value in the age colum
exceeds 15 would be displayed. At first I thought I could use an I
function but as far as I know IF function results are actual values an
not commands. Perhaps I need to use a macro though I would like t
stay away from macros if possible. Would anyone be able to suggest
function that may work and, further, how to use it? Thank you!!!!!!!
 
Hi,

maybe you can try "Data - Filter - Advanced Filter" (i hope i've
translated this correctly from my German version). In the appearing
dialog you can enter the sorting are and a criteria area.

Frank
 
you could write the following macro, and assign it to a button.

Age = InputBox("Enter Age", "Age", 35)

Criteria = ">=" + Age

Selection.AutoFilter Field:=X, Criteria1:=Criteria, Operator:=xlAnd

where X is the column number from left of Age column. for example, if
Age column is E, then X = 5.
 
Back
Top