Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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?
0
j8547
Asked:
j8547
  • 6
  • 5
1 Solution
 
Michael FowlerSolutions ConsultantCommented:
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
 
j8547Author Commented:
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
 
aikimarkCommented:
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
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
j8547Author Commented:
do you know how i can fit a wildcard in?
0
 
aikimarkCommented:
look at my criteria range on the first worksheet.  I used a wildcard.
0
 
j8547Author Commented:
the execute query didn't work so wasn't sure what was working
0
 
j8547Author Commented:
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
 
aikimarkCommented:
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
 
j8547Author Commented:
is there a way i can see the manual advanced filter you applied?
0
 
aikimarkCommented:
Do you see the criteria range I created on the first sheet?
0
 
j8547Author Commented:
yes
0
 
aikimarkCommented:
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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now