Hello,
I have a workbook with 2 opened windows, using the View > Window > New Window buttons. The code i need is that if one of windows are closed the other one would be closed as well. Any help or tips?
Hello,
I have a workbook with 2 opened windows, using the View > Window > New Window buttons. The code i need is that if one of windows are closed the other one would be closed as well. Any help or tips?
To close a workbook based on an event in that workbook requires that you use a macro in another workbook: this should go into a standard codemodule in your Personal.xlsb
![]()
Please Login or Register to view this content.
Then:
1) Copy this code.
2) Open the VBE (press Alt-F11)
3) Select your workbook in the project explorer
4) Double-click the ThisWorkbook object
5) Paste the code into the window that appears.
6) Save the file as a macro-enabled .xlsm file.
Change False to True in the CloseMe macro if you want to save changes before closing the workbook
![]()
Please Login or Register to view this content.
Bernie Deitrick
Excel MVP 2000-2010
Works great. Thank you for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks