Macro to check dropdown value and increment a counter
Looking for a way to build a macro to run "On exit" that checks the value selected in a dropdown, and then increments a counter based on that value. For example, a WORD template has several dropdown boxes and each box has three choices from which to select - A, B, or C.
If the user selects "A", a counter for "A" gets incremented by 1 eg., Cntr_A = Cntr_A + 1. Presuming a need for a variable to identify which dropdown/bookmark the macro is working. That is if the template has 50 dropdown boxes, it would not make sense to write a separate macro for each one. There must be a way to tell the macro which bookmark it is working.
Please provide sample code or pointers to code or reference material from which I can glean a method for solving this.
I am working with versions of Word ranging from 2003 to 2013.
Thanks much,
Ferg
|