Detecting when a table filter is changed

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,144
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Evening all

I have been searching this for a while tonight, with no luck.

I tried sheet_calcualte and chance events. It appears filtering a table does not trigger any of these.

In short, im trying to run a macro when a table filter changes to update some stats.

Obviously i can add a button for the user to call this, its just i think it happening automatically is better. If possible, maybe not.

Thanks

Dave
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Please try the following.
Somewhere (anywhere) on your sheet with the table(s) put the following formula:

Excel Formula:
=COUNTA(A:A)

Then try using the Private Sub Worksheet_Calculate() event handler again.
 
Upvote 0
Solution
I didn't find @kevin9999's count to trigger the Calculate Event but using that concept you could try using this to trigger it:
Excel Formula:
=SUBTOTAL(3,Table1[Col1])
 
Upvote 0
Hi Both

Really appriciate you looking at this.

Kevin, so i tried your approach, and yes, it works, thankyou. So long as i tied it to some of the data in the table range. The change event was triggered.

Alex, yours worked also.

Thanks both for your cool approach. And your time.

Dave
 
Upvote 0
It possibly does not matter for your intended use but note that neither suggestion specifically detects when a table filter is changed per your thread title & post 1 description.
If you click one of the filter drop-downs and then click 'OK' without changing anything, the event is still triggered.
 
Upvote 0

Forum statistics

Threads
1,225,969
Messages
6,188,111
Members
453,460
Latest member
Cjohnson3

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