... Value property in Range () in VBA

Some Excel VBA code I have seen does not use the .Value property on the Range object, for example:

myX = Range("A1")

      

but not

myX = Range("A1").Value

      

Is it just because the default behavior of a range object is to return a value in a cell? Is there ever a time that I wouldn't want to use this property to access a numeric value in a cell?

+3


source to share


1 answer


Value is the default property for Range. This way, any code that expects a property and is only a range will get a value.



There are other properties that return the "value" of a range, such as Value2, Text, and sometimes Formula *, which have specific uses.

+3


source







All Articles