Okay guys, so now we're going to speak about the worksheet, deactivate event. Okay, so the worksheet deactivate event gets triggered whenever you just deactivate a worksheet. So I've created a worksheet here called deactivate event. And we're actually going to write some code that's going to be triggered whenever this worksheet is deactivated. Okay, so I'm going to go to the developer tab on the ribbon and click on Visual Basic. I can also hit Alt F 11 on my keyboard.
We're going to make sure I'm in the deactivate event worksheet here by double clicking it and then I'm going to from this menu, I'm going to select worksheet and from this menu here for the event, I'm going to select deactivate Okay, I'm going to delete the selection change event because I'm not going to use it. Okay, and we can write a message box that would appear would just say goodbye whenever you just deactivate the worksheet. Okay, so I'm going to deactivate the deactivate event worksheet and activate maybe the worksheet activate event. As you can see here, I had a message box says goodbye and actually another message box as well has appeared. And fourth of which is where the activation of the worksheet activate event cheap. Okay, so this is how it works simply you just deactivate the worksheet and whatever code you write would be triggered.
Okay guys, so we're gonna have another practical application here for the worksheet, deactivate event. So in this dashboard as well, that is a simple dashboard on my dashboard scores whenever I deactivate the dashboard worksheet, the ribbon gets shown again. Okay, so this is because I've got a worksheet, deactivate event that just calls the macro called show ribbon, which is this one here that shows the ribbon. Okay, so I'm going to include that for you as well, in the example workbook. Okay, so that's another packed practical application, something that you can do. In the real world with the worksheet, deactivate event and there are many, many and numerous applications for that.
Okay, so thank you guys for watching this video. I'll see you on the next one.