In this video, we're going to see how we can move sheets using Excel VBA. So to move sheets in Excel VBA, you could write the name of the worksheet. So worksheets sheet one dot move and there is actually a before or after parameter that you need to put if you need to move it in the same workbook. Okay, so let's say worksheets sheet, one dot move, and then it's going to be put after calling equals worksheets, sheet two. Okay, so this is going to move sheet one to be put after sheet two, and that is to the right hand side of sheet two. So if you run that, you can see here that sheet one has been moved to be after sheet two, or to its right hand side.
If you remove the before or after parameters, what's going to happen is that it's going to be moved to a new workbook new workbook will be created and sheet one is going to be moved to it. So if you run that, you can see our sheet one has been moved to a new workbook and then you could take that workbook, do whatever you want with it and we will learn about workbooks shortly in the course. Okay, so thank you very much guys for watching this video. I'll see you on the next one.