Okay guys, so now we're going to speak about the worksheet activate event. Okay, and before we start speaking about it, I just want to tell you that I actually changed the name of the worksheet that was named sheet one, when we were explaining the selection change event. I renamed it to selection change event, okay? And let's speak about the worksheet activate event. Okay, so we can go to that event the same way or actually, there's another way to do it, which is by right clicking on the worksheet itself that you need to create the event for and then click on View code here. Okay.
And then from this menu, you choose worksheet instead of general and then from this menu here on the right, you choose activate. Okay, I'm just going to delete the selection change because I'm not going to use it right now. Okay, so we are in the worksheet activate event for the worksheet named worksheet activate. Okay, so You can Xir worksheet activate is highlighted, we're in the worksheet activate event. So what this does is that it simply executes whatever code you write between the private sub and the end sub when you activate the worksheet. Okay?
So for example, we can have a message box you have triggered triggered the worksheet, activate event. Okay, this is a message box. This message box is going to appear whenever we activate the worksheet activate worksheet. Okay, so I'm going to create a new sheet here and I want to add a new sheet and then I'm going to go back to the worksheet activate an activated and you can see here that the event has been activated. Okay. So that's it.
It's very simple. you activate the worksheet, whatever code you write between the private sub on the end software, the worksheet activate event gets executed. Okay guys, so I want to show you actually a practical application for the worksheet activate event. Okay, so I've got here a dashboard is a sample dashboard that I've created on my Excel dashboard scores. And I actually have some worksheet activate code here that that is triggered whenever I activate the dashboard worksheet on this workbook. Okay, so what this does is that it just hides the ribbon and all the Excel features here so that he would, you know, make the user feel like it's he's not in Excel, he's in a different application.
So you just hide the ribbon. Okay, and we've got some code actually, that does that here. So I can include that code for you. This code will hide the ribbon. Okay, so this is a practical application. For worksheet activate event, okay, so that's it.
Basically the worksheet activate event is very simple. You just include the code between the private sub and the N sub and it will be launched whenever you activate a certain worksheet.