View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Conceptual question on .Value and .Formula properties

Activecell.Formula = 100

produced a number stored in the cell for me. Are you only talking about
reading - it isn't clear (to me).

--
Regards,
Tom Ogilvy


"Peter T" <peter_t@discussions wrote in message
...
There is a slight difference in as much as the formula is always a string,
so a little more coercion may be involved behind the scenes, no doubt
trivial for write. When reading the formula of a non formula cell it
returns
the Value2 property. I would stick with Value for read/write unless Value2
is required.

Regards,
Peter T

"Stefano Gatto" wrote in message
...
Ok, thank you for confirming my thought. There is no difference in Write
mode, there is just one in Read mode.

Still all of the examples I see (including Microsoft's ones) use .Value
to
assign numbers and strings to cells. If it's so irrelevant then I would
expect more of a 50-50% split...

Thank you for your answer and have a nice day.
--
Stefano Gatto


"IanKR" wrote:

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

Formula or Value?

If you're writing to a cell it doesn't matter, but if you're looking at

a
cell that contains a formula (say, =A1+A2), the difference is that

Formula
returns "=A1+A2" (without quotes); whereas Value returns what that

formula
evaluates to.