Is it possible to have Excel 2007 display a list of result

We have used vlookup, find, search, mid, left, right, etc. to search and display a singular cell contents.  But can Microsoft Excel  2007 be used to display a list of results?

Attached is an Excel with what we think it would be set out.  In this example we have an area where the 'Data' is store, then where the user inters the data to search, finally, the Results display area.  

Is this possible? and how can we go about it?


DisplayListResult.xlsx
rayluvsAsked:
Who is Participating?
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
See attached, your original and a Copy sheet.

Filter button on the Copy sheet runs this routine:

Sub Filter()
'
' Filter Macro
' Macro recorded 29/09/2011 by Rob Henson
'

'
    Range("K7").Select
    Selection.CurrentRegion.Select
    Selection.ClearContents
    Range("K7").Select
    
    Range("D7").Select
    Selection.CurrentRegion.Select
    With Selection
        .AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
        "H7:H8"), CopyToRange:=Range("K7"), Unique:=False
    End With
    
End Sub

Open in new window


That clears the result area and filters the Data.

Thanks
Rob
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
Looks like you can use the AutoFilter or Advanced Filter functions for this.

Auto Filter would filter in place whereas Advanced Filter can be used to filter to another location.

Adv Filter would be better for your purpose as it requires 3 inputs:
Data Range - Your Data
Criteria Range - your Enter Data to display range for your example this would be input as *speed*
Output Range - your Results.

This can be automated so that it updates at the click of a button if so required.

Does this sound like a way forward?

Thanks
Rob H
0
 
Arno KosterConnect With a Mentor Commented:
sure.

easiest way is to place a filter on the data range and select "text filter" - "contains" - "*speed*"

as in the M column

 DisplayListResult.xlsx
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Doddsy1000Connect With a Mentor Commented:
I'm sure I've mis-understood the question.  Please use the attached to clarify.

thanks

Ian

DisplayListResult.xlsx
0
 
rayluvsAuthor Commented:
Yes, that's what we're looking for.

But is there a way to go straight to "Contains" instead of Click Filter >> Text Filter >> Click Contains ?
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
Ooops, attachment.
Display-List-Result.xls
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
The ranges in the routine are currently 'hard-coded'.

As the data will no doubt change shape, the ranges can be made dynamic.

Thanks
Rob H
0
 
rayluvsAuthor Commented:
Great!... i see that in order for CONTAIN to work, there has to be '*'.  Can the filter always use CONTAIN so the user just enter the word|? (for example if I enter 'speed' nothing is display, but if i enter *speed or *speed*, it does)
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
I guess you could set a change event on the sheet that whenever anything is added to the search list an * is added.

Alternatively, you could use the same input but have the actual criteria list of to one side with formulae populating the * onto the words entered.  This new criteria list would then have to be dynamic so that the filter knows how many rows it needs to look at.

Thanks
Rob H
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
BTW in case you weren't aware the * is a wild card for any character(s). You can also use ? for a single character.
0
 
rayluvsAuthor Commented:
I just finished incorporating your recommendations and it doesn't work.

Question:

The title all have to be 'Data'? (we have other titles)
0
 
rayluvsAuthor Commented:
i just tested changing, it seems that all title have to be the same?
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
Yes the tiles have to be the same, or at least the cell above the first row of data!!

The Advanced Filter function is saying:

Look at table of values, in column Data find the values specified in the criteria table with criteria for column Data and return the values that match the criteria. It would make more sense if you had more columns, the example in the Help is very basic but proves the point. It has an orchard with multiple trees of different fruits with various heights and ages.

So you have columns for:

Fruit    Height (Ft)    Age (Yrs)
Apple  10                 2
Pear    10                 1
Apple    6                  1
Apple    5                  1

You could then set up a criteria table with

Fruit       Height(Ft)
Apple     >5

The result would then be:

Fruit    Height (Ft)    Age (Yrs)
Apple  10                 2
Apple    6                  1

As you can see you only need the column headers for those columns for which criteria are being specified. Likewise the result table can be preset with only the headings you require data to b extracted for.

In your example you could make the headings different by adding more to the cell above, like you did for the criteria in your original post; the AF looks at only the first row of the range specified and treats that as the header.

Thanks
Rob H
0
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
Reading your question in a different light, possibly answered with the Orchard example, the title doesn't have to be "Data" but the titles of the columns in the data have to be repeated in the title for the criteria and will then be repeated in the title for the result. Going on from what I suggested about adding to the cell above the header, the result will only have the immediate header so any extra titles will have to be added before and will stay when the filter is refreshed if the result area is set as the row below.

Thanks
Rob H
0
 
rayluvsAuthor Commented:
Thanx you very much!
0
 
rayluvsAuthor Commented:
Thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.