Okay guys, so now we're going to have an exercise for the message box. So in this exercise, I need you to create a message box that would ask you whether you would like to clear the data or not. And this message box needs to have Yes, and no buttons, and it also needs to have the VB questions sign. So using this message box, when you're asked whether you'd like to clear the data or not, you're going to either clear the data on the left or not clear it. So if you click Yes, then the data on the left would be cleared except for the headers, you're not going to clear the headers you just gonna clear the data. And if you click No, then the macro ends.
And as a note, please make sure to find the last row and clear only the rows having the data and not all the rows on the columns A to F so don't select all the rows to the very bottom the work sheet and then clear them. No, that's not efficient. I need you to find What the last row is and only select from row two till the last row, and then you're going to need to use the range dot clear contents method. It's a very easy method. This method just clears the data in these cells in a range object. So it can be used with the range object, and it can also be used with the cells collection object, you can google it Speight.
JOHN, I missed the understand, I'm not going to give you the link, I need you to Google its page on the MSDN and read about it. It's very easy. And then I need you to assign the macro to the above button and test it. Okay, and make sure it's working fine. If you have any issues, and you want to try again, after deleting the data, here is a backup copy of the data so you can copy the data again, put it back and test it. And if you get stuck, I've got the answer here for this exercise in this exercise answer module.
So if you get stuck Look at the answer. So please attempt the exercise and if you have any questions, please leave them in the q&a section. Thank you very much for watching this video. I'll see you on the next one.