Is ".Value" important ?

alextang0112

New Member
Joined
Oct 31, 2012
Messages
35
Hi guys,

What's the difference between .cells(1.1).value and .cells(1.1) ?

Is it true that in most cases they work the same ?

Thank you.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
.cells(1.1) it can refer to anything.. value, formula, format and other formats as well. but when you say .cells(1.1).value you are referring to values attribute of cell only.
e.g. If you copy a column contain some formula and just paste as CTRL+V then you would see there are some values different than original (because of formula) but if you paste copied data using pastespecial->values then you will have same data as copied.
 
Upvote 0
In most cases, then yes, they will behave the same, this is because the default property of .cells(1.1) is .value , so referring .cells(1,1) will usually return its value it is however not encouraged. The problem is that this is dependant on how it is used, for example:

Code:
Sub test()
    a = Range("a1:a5") 
    Set b = Range("a1:a5")
End Sub

a is not the same as b, a is an array whereas b is a range object. It's therefore useful to be explicit in what you mean.

.cells(1,1) returns a range object, this object has a ton of properties and methods, formula text etc etc... only one of which is value, but since ms believe that this is the most commonly requested property they have set it as the default property of the range object.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top