I use event code within the worksheet, workbook and application classes and I understand that there are events that will trigger responses within all 3 classes - an example would be a range selection change ("SelectionChange" within a worksheet object, "SheetSelectionChange" within a workbook or application object). I further understand the order of events is from least significant object to the most significant object (so the worksheet event code will go first, followed by the workbook event code and finally the application event code). Finally, I believe that I am on the right path in trying to leverage the "Application.EnableEvents" property (set it to false to stop all responses to event triggering and back to true when you want the code to pay attention to event triggering). It's my belief that I should be able to trap and respond to an event at the worksheet level, and stop the event from being trapped and responded to at the workbook and/or application level.
So far, I have been unsuccessful. I have attached 2 example workbooks that contain the bones of the code with which I'm tinkering - Test-Event-Enable-1 puts event code in the worksheet code in the sheet module, workbook code in ThisWorkbook and application code in a class module; Test-Event-Enable-2 puts event code for all objects into class modues. SetupEvents / SetupAppEvents must be executed to turn the turn event handling on and I simply incorporate msgbox code to reflect what event code module is being executed when I select different ranges on a worksheet.
Would anyone have any advice / suggestions (if this is not possible, I'd even like to know that). Many thx, BFRG
Bookmarks