View Single Post
  #1   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

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