On 30 June, 16:24, Matthew Dyer wrote:
This should be a simple solution but I can't figure it out... Here is
the line of code I'm having issues with -
* * .Formula = "=(((COUNT(b:b)+" & var1 & ")*5)-SUM(b:c))/" & var1 &"
Why isn't this working for me? I used the same basic "& _ &" roadmap
in the following code with no problem
Range("H7").Value = "In " & var1 & " Days:"
hi
i noticed in your formula that the ampersand symbol(&) is WITHIN the
double quotes. this makes it text along with var1.
the ampersand symbol should ALWAYS be OUTSIDE of the double quotes ie
..Formula = "=(((COUNT(b:b) +" & var1 & ")*5)-SUM(b:c) )/ " & var1
the above is tested in 03 and works.
also I noticed that in your second example, the ampersands are
OUTSIDE of the double quotes as is var1.
if you have trouble understanding this, look at it this way....
Range("H7").Value = "Inside " & outside & " inside:"
the ampersands concatenates all of the text(numbers,other) between the
multiple double quotes.
anything WITHIN the double quotes is taken literally by excel(
VB).
anything OUTSIDE the double quotes are declared variables. (you did
declare them and assign values, didn't you)
regards
FSt1