Well put Shg!
How would a new workbook be opened/created if you have disabled menus, etc?
This might be what the other person meant
Private Sub Workbook_Deactivate()
MsgBox "different workbook"
End Sub
Copy Code to a Workbook Module
Copy the code
Select the workbook in which you want to store the code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
Right-click on the ThisWorkbook object, and choose View Code
Where the cursor is flashing, choose Edit | Paste
Bookmarks