Thanks, but using this method, what am i doing wrong here
Code:
.Formula = "=IF(V_P1_T_0"" & x & ""=0"","""",""£"" & ""V_P1_T_0"" & x & ""m""& "")"
Okay, I need to expand my explanation a little bit. When I referred to a text constant, I meant each one you had individually. When you concatenate text together each part being concatenate (that is, the beginning and ending ones plus each one appearing between & signs). So, if you had these two text string...
The boy said "Hello" first
he said "Good-bye" next
and let's say you had a variable named Splice that contained the text " and then ", so the final printed out text should be...
The boy said "Hello" first and the he said "Good-bye" next
You would concatenate the original two text string and the Splice variable together like this...
"The boy said ""Hello"" first" & Splice & "he said ""Good-bye"" next"
Another way to view this would be to use individual variables for the text parts and see how my original rule is used to assign them...
Var1 = "The boy said ""Hello"" first"
Var2 = "he said ""Good-bye"" next"
Splice = " and then "
Concatenating these together yields...
Var1 & Splice & Var2
Now look what you get if you replace Var1 and Var2 with what they are equal to...
"The boy said ""Hello"" first" & Splice & "he said ""Good-bye"" next"
but this is just what we got above when we applied the rule I originally gave you to each text constant individually. Now, one more thing I would like to show you as it tends to be confusing the first time come across it.. when there is a quote mark at the beginning or end of an individual text string as in this example...
The boy said "Hello"
First, double up the existing quote marks...
The boy said ""Hello""
and now surround it with the quote marks that tell VB it is processing a text constant...
"The boy said "'Hello"""
Note what you end up with when the original text has a quote mark at the end (or beginning for that matter) of the text string... you end up with 3 quotemarks... the two that replaced the original one that was part of the text and a third one for the quote mark that delineates the text constant to VB.
Hopefully this has helped you some. Normally, I would show you the corrected text string for the formula you asked about, but I am not sure what that formula should be as you seem to have left something out. As posted, and if I were able to correct the quote marks for you, you would be left with this as part of your formula...
"£"V_P1_T_0
a quoted £ symbol followed by text that does not look like it should be next to that symbol. If you cannot get the quote marks straightened out on you own, then post the actual formula you expect to be in the cell along with what you think the VB assignment should be and I believe someone here would then be able to show you the correct method to perform you concatenation.