In this video, we're going to discuss the range dot count property. So the range count property, what it does is that it gives us the count of the cells in a range, and it will count the cells regardless if they contain values or not. So even if the cells are blank, they will still be counted. And that is unlike the count function in Excel, the worksheet function count, which you get by writing equals count in a cell, this function will only count the cells if they contain values or numbers, okay. So if they are blank, they will not be counted in the content text, they will not be counted if they contain errors, they will also not be counted. Okay, so to have an example, we can actually write range and then we're going to count the cells In the range that is called my table, the named range that we have created before.
So the right range, my table dot count, and we'll put that inside a message box. So if we run that, it will actually give us the number of cells in that range. Remember, guys, the table range was between a one to F 10. So if we run that, it will give us the count of the cells in that range. So how many cells are in that range? We've got 60 cells because that ranges, six columns by 10 rows, okay.
So, as you can see, as well, the cells have been counted, regardless if they contain values or not, you see the cells are blank, but they have still been counted. But in case of the count function, the count function will not count blank cells. Okay. So I will also show you how to use the countdown function through VBA. Here, we'll probably should have a separate video on how to use worksheet functions in Excel VBA. But I'll just show you how to use the count function here.
So I'll actually put some values in my range first range my table. So put 10 here, for example, any value, press Ctrl, enter to just fill the whole range with this value. Now I can actually count the number of cells in that range using the count function. So right application worksheet, function dot count, and then I'll put my range which is range, my underscore table, okay, and I'll put that inside a message box. So if we run that, you will see here that we will get 60 because all the cells contain values. Remember, the count function does not count empty cells.
But if we clear some of the cells here, make them empty, and we run that again. So I've actually cleared 10 cells, so that should give me 50. So as you can see here, we've got the count function, giving us 50 cells as the count of the cells, because it does not count blank cells. Okay. So we will have actually another video in the course about how to use worksheets functions in Excel VBA. But just wanted to show you the difference between the range count property and the worksheet function that is called count.
Okay, so thanks guys for watching this video. I'll see you on the next one.