Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Conrad Evans   on Nov 14 In MS Office Category.

  
Question Answered By: Silvia Chapman   on Nov 14

As I indicated before, a cell  can only hold one thing - either a value  or a
formula.

Your Range(RefEdit).Value is going to completely replace the formula/value
contents of all the cells  in your range with the value of "n".

As you are executing it from within a loop, the cells will be given each value
of "n" in turn, but of course you'll only see the last one.

There is really no such thing as a value in a cell (as a separate item). The
value is actually just a different view of the contents of the cell. For
instance, try

Range("a1").Value = "=3+1"

If you look at A1, it'll be showing 4, but if you edit it, you'll see that it
actually contains "=3+1". I.e. it doesn't matter whether you put the formula
into the cell via .Value or .Formula.

However, if you look at the .Value and .Formula properties of the cell, you'll
get "4" and "=3+1" respectively. I.e. you get the same thing back - just two
different views of it:

MsgBox (Range("a1").Value) returns "4"
MsgBox (Range("a1").Formula) returns "=3+1"

I suppose the question is what are you trying to achieve? What sort of formula
would you want to have in a cell that you also want to store a value in? What
are you trying to do in these cells?

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 


Tagged: