Best approach to using a filter.

Livin404

Active Member
Joined
Jan 7, 2019
Messages
392
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Greetings, I completed a spreadsheet where I extrapolated from a database totals based on tons. These totals are on the same worksheet as the database. On that same database I have a drop down box where I can chose “Contingency”, “Humanitarian”, “Support”, and “All”. The drop down box begins at B2. The Totals from this database begins at K7. I am hoping I can identify totals based on the selection made within that drop down. I’m basically looking for a filter that will still keep my spreadsheet working properly. I’m trying to make it as easy as possible for the user to use a filtering process. I’m thinking a VBA with buttons labeled with the criteria. Thank you.
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

fadee2

Active Member
Joined
Nov 7, 2020
Messages
336
Office Version
  1. 2019
Platform
  1. Windows
Hi Livin404,

Assuming the sheet in question is sheet1, with headers in A1 to L1, the column containing criteria (“Contingency”, “Humanitarian”, “Support”, and “All”) is column B, and your dropdown box resides in Cell C3, then bind following code to a button on worksheet.

VBA Code:
Worksheets("Sheet1").Range("A1:L1").AutoFilter Field:=2, Criteria1:=Range("c3")

hth...
 

Watch MrExcel Video

Forum statistics

Threads
1,128,133
Messages
5,628,896
Members
416,352
Latest member
Lunox01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top