Filter by Selection

Yamezz

Active Member
Joined
Nov 22, 2006
Messages
336
Office Version
  1. 2019
Can anyone point me in the right direction to write a macro that filters my table by the values currently selected?

Currently, to filter my data I have to click the filter arrow on ColumnA, un-select the "select all" box, then scroll through the list to select the value I want to use in the filter. I then move on to do the same for ColumnB, ColumnC and ColumnD. Doing this all day gets tedious, so I want to be able to just use the mouse to highlight a selection in a single row and use the selection as the inputs for the filter.

i.e. highlight W,X,Y,Z in a single row, press a macro button and the VBA code filters my data for W in ColumnA, X in ColumnB, Y in ColumnC and Z in ColumnD.

Thanks.
 
This macro has been such a time saver every working day. So much so, I'd like a similar one, but writing the code myself has got me beat. I'd like to be able to use the selection in Sheet1 to filter the data in Sheet2. The selection in Sheet1 will always be columns D, E, F and G in a single row. The columns I need to filter in Sheet2 are I, J, K and L, with the headings in row 2 (subtotal formulas are in row 1). Any ideas?
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Bump...

It would be much appreciated if anyone could point me in the right direction here. Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,273
Members
449,219
Latest member
daynle

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
Back
Top