Excel VBA - Trigger a Macro from a drop down box change without saving the code to the Worksheet -


i want macro "aims_criteria" run when there change in "aims" worksheet drop down data validation box in cell a1.

i've seen posts people suggest right clicking sheet, going view code , paste this:

private sub worksheet_change(byval target range) dim keycells range set keycells = range("a1") call aims_criteria  end sub 

however won't work me each week, data in worksheet exported sheet. reason, need of macros in personal.xlsb.

is there anyway can achieve need without changing code in specific sheet?

thanks

follow instructions find here (http://www.cpearson.com/excel/appevent.aspx) capture application events. class module should in personal.xlsb.

the sheetchange event fire every time make change in worksheet in workbook. therefore have check a1 changed in worksheet in workbook want run macro.

in sheetchange event can identify workbook sh.parent.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -