?
Solved

Excel VBA Query

Posted on 2013-06-04
14
Medium Priority
?
203 Views
Last Modified: 2014-05-23
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?
0
Comment
Question by:j8547
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
14 Comments
 
LVL 23

Expert Comment

by:Michael Fowler
ID: 39221712
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
0
 

Author Comment

by:j8547
ID: 39222118
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
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39222161
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:j8547
ID: 39222218
do you know how i can fit a wildcard in?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39222233
look at my criteria range on the first worksheet.  I used a wildcard.
0
 

Author Comment

by:j8547
ID: 39222253
the execute query didn't work so wasn't sure what was working
0
 

Author Comment

by:j8547
ID: 39222259
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
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39222271
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.
0
 

Author Comment

by:j8547
ID: 39222663
is there a way i can see the manual advanced filter you applied?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39222687
Do you see the criteria range I created on the first sheet?
0
 

Author Comment

by:j8547
ID: 39223107
yes
0
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 39223413
I provided the data range and the criteria range to the AdvancedFilter dialog.  You can change the criteria cells (there are three rows, including the column name row) and reapply the Advanced Filter.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question