Worksheet "A" has a Worksheet_Activate sub which resizes the window (if window in Normal state). Worksheet "A" has a Worksheet_Activate sub which resets to the size when the sheet was activated.
Activate procedure runs correctly when activating from any other sheet (including Worksheet "B").
Deactivate procedure runs correctly whether the sheet is deactivated by using PgUp/PgDn keys to move to an adjacent sheet or mouse clicking any other sheet with one exception as follows:
When Worksheet "A" is deactivated by activating specifically Worksheet "B" (whether with keys or mouse), the Deactivate procedure is not called.
I have tested this with a break and a Msgbox in the Worksheet "A" Deactivate procedure. I have also searched for other possible factors:
- Worksheet "B" has no Activate or Deactivate procedures.
- No procedures in the workbook contain Workbook_SheetActivate or Workbook_SheetDeactivate.
- Application.EnableEvents remains True throughout all the tests.
It appears to me that the "other" sheet being selected cannot affect the event handler as the deactivate event should be tripped before any other events.
I have tried everything I can think of - completely stumped!
Any ideas why the Deactivate event is failing only when one specific other sheet (Worksheet "B") is selected?