In this video, we're going to talk about the value and text properties for the range object and we'll see how they differ from each other. Okay, so I'm going to go to my VBA editor here, I'm going to insert a new module, I'm going to make a new macros sub, my value, for example. Okay? So if I say range, a one dot value, if I type that and then I put it equal to 12, and I run that, it's going to put a one equals to swell. Okay, and actually, the dot value property is the default property for the range object. So as you've seen on the previous video, on a previous video, we ignored the dot value property and we just set a one equals to 12.
And it would still put a one equals to 12 or equals to the value that You've put after the equal sign because the dot value is the default property. So if you emit the property, the dot value property, Excel will assume that you mean the dot value property when you write that statement, okay, now, let's do something else, which is I'm just gonna give this 12 a bit of formatting. Okay, so I'm gonna make it $12. So the value is actually 12. But how it looks is that it's $12. So this is how it appears to me, but the actual value is 12.
And I'm just gonna verify that by writing a message box function, and I'm gonna ask it to give me a range, a one dot value, and we'll talk about the message box function later on. But just for now, you get to know that all it does is that it displays a message box and it gives you what's inside the message box function. So I'm gonna run that and you'll see that a message box has popped up, and it's got the value for range a one. So because it asked for the value, it gave me 12, because this is the value that's in cell A one. However, if I asked for the text, so there's another property for the range object, which is called the text, it's gonna give you the actual text that's appearing to you. So if I run that, you can see here they've given me $12, because this is the text that's appearing in the cell.
Okay, so now we've seen how the value and the text properties differ from each other. The value property gives you the value of the cell of what's inside the cell. And actually the The text property gives you the text that's appearing to you in the cell. So that means that if you've got some formatting applied to the values of the cell, it will actually give you the text which includes the value and the formatting basically. And actually, what you get as an output from the text property is basically a string. So a text basically.
Okay, and we'll talk about strings and the data types of different data types in VBA later on, so thank you guys for watching this video. And please follow me on to the next