Simple (?) Event Question

JustinWWolcott

Board Regular
Joined
Mar 20, 2007
Messages
158
I have a sheet with 14 columns of filtered data which generates a graph.

Is there any way to run a macro whenever one of these filters is changed (for example say I change class year from Junior to Senior, I want the macro to fire).

Thanks,
-JW
 

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.
Hello,

the filtering itself does not fire an event-macro. But if you e.g. use one formula like SUBTOTAL in my following example:
Excel Workbook
ABC
113
2Value1Value2Value3
3432363
4439728
5453995
634598
766377
8287989
9823836
1031619
1162322
12853945
13697449
14725932
15461942
Sheet


you can use a Worksheet_Calculate to start the code:

<div style="background-color:#FFFFFF; border-width:2px; border-style: groove; border-color:#ff9966; padding:4px;"><nobr><span style="font-family:Courier New,Arial; font-size:9pt ;" ><span style="color:#000080"; >Private</span> <span style="color:#000080"; >Sub</span> Worksheet_Calculate()
    MsgBox <span style="color:#800000"; >"Hello"</span>
<span style="color:#000080"; >End</span> <span style="color:#000080"; >Sub</span>
</span></nobr></div>
 
Upvote 0

Forum statistics

Threads
1,217,347
Messages
6,136,046
Members
449,984
Latest member
Ffprojectjkt

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