Link to home
Start Free TrialLog in
Avatar of j8547
j8547

asked on

Excel VBA Query

I have an excel spreadsheet with data that i am look to execute a query to filter it. I want to filter the data in "Measures List" tab by executing a query on the "Input" tab. The issue is I don't know how to query on multiple variables for each criteria.

So for example, I want to be able to select High & Medium in the Impact Potential column and also a number of time frames in the "Total Time" column & also be able to search for a wildcard in the Focus Area & Responsibility columns.

Can anyone help me on this?
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Without an example sheet it is hard to be specific but this may help

http://office.microsoft.com/en-au/excel-help/filter-by-using-advanced-criteria-HP005200178.aspx

Michael
Avatar of j8547
j8547

ASKER

Sorry forgot to attach the sheet. I have now.

All help is appreciated. I am looking for the VBA code for the query.
test.xlsx
Avatar of aikimark
You should populate a criteria range with your filtering data and the apply an advancedfilter to the data.  See the attached workbook for an example.

Also, I've done an EE podcast on advanced filtering, which is viewable on the EE YouTube channel, which you might want to watch.
http://www.youtube.com/watch?v=0M4gePK8510
test.xlsx
Avatar of j8547

ASKER

do you know how i can fit a wildcard in?
look at my criteria range on the first worksheet.  I used a wildcard.
Avatar of j8547

ASKER

the execute query didn't work so wasn't sure what was working
Avatar of j8547

ASKER

Sorry for tall the questions just can't find how you did it. how then can I add filter 2, 3, 4 and so on.

Thanks for the help
I manually applied the AdvancedFilter.  Advanced Filter is one of your filtering options.

The video shows the VBA statements that can be used to apply an advanced filter.
Avatar of j8547

ASKER

is there a way i can see the manual advanced filter you applied?
Do you see the criteria range I created on the first sheet?
Avatar of j8547

ASKER

yes
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America 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