Hey guys, welcome back. So in this video we're going to speak about the workbook deactivate event. So the workbook deactivate event triggers whatever code you write in it whenever you deactivate the workbook and go to another workbook, actually not to another application. Okay, so it doesn't work if you deactivate Excel and go to Microsoft Word for example, it works when you deactivate this Excel workbook that has this particular event and go to another Excel workbook. So you can get it of course by opening your VBA editor double clicking on this workbook here and selecting from this menu, selecting workbook and from this menu here, you're going to see select the activates Okay, so I'm going to delete the workbook open and it's very simple. It works whenever you deactivate your workbook.
Okay, so I'm just going to have a message box says looking forward to seeing you again So I'm gonna press Ctrl N on my keyboard to open a new workbook. And actually, you know, the moment I opened a new workbook, the message box popped up. So I'm just gonna go back to my workbook again here and go to the new workbook that I had open and you can see here, message box popped up whatever code you put in there, or whatever code we put in the event has been executed. Okay, guys, so that's it for the workbook deactivate event. It's very simple. It just runs any code that you write in it whenever you deactivate the workbook that you've written the event for and activate another Excel workbook.
Okay, just bear in mind that it runs when you activate another Excel workbook, not another application. So feel free to use your imagination and use that event and tailor it to whatever application you will like to use it for basically, okay, so thanks very much for watching this video guys. I'll see you on the next one.