View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Stefano Gatto Stefano Gatto is offline
external usenet poster
 
Posts: 59
Default Conceptual question on .Value and .Formula properties

Yes, I saw that right after having posted my question... The class is range
and .Value applies to the most top-left cell I imagine.
--
Stefano Gatto


"Jim Rech" wrote:

There is no Cell class. There is a Range object that includes one or more
cells.

Is there a real difference?


The real difference is in reading a cell.

Jim
"Stefano Gatto" wrote in message
...
One question I have on the Cell class of Excel...

Which property is better to assign when you need to programmatically write
something in a cell?

Formula or Value?

Should this choice be made on the nature of what we want to store in a
cell.
In other words, if we want to store 56 then it's better to assign the
.Value
property and when we want to assign =34+69 or =$A$3^3 then it's better to
use
.Formula instead?

Ok, but then why not consistently use the .Formula property then? .Formula
works in all cases (e.g. ActiveSheet.Cells(1).Formula = 98 perfectly
works),
but I keep on reading in web sites and manuals that .Value is used
instead.

Is there a real difference?

My personal preference would be that .Formula is read/write and can be
assigned. Value would be readonly and is calculated by Excel exclusively,
as
a result of the cell's Formula.

Thank you.
Stefano Gatto