Say, I have a procedure which changes the random colour of a cell based on selection change. I know that I can code in a procedure for the worksheet SelectionChange
event.
I guess Im asking, as in javascript where we can use addEventListeners
, can we do something similar in Excel VBA.
What I am wondering is can this be done dynamically? I.e. when a user chooses an option, then I bind a procedure to the event SelectionChange
of the worksheet.
Note, I know that I could declare a global boolean & use that to ascertain user action & use it in my SelectionChange
event procedure.
Im just curious whether in Excel VBA, we can dynamically append procedures to events?