Thread: Double Quotes
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Tjia John Tjia is offline
external usenet poster
 
Posts: 32
Default Double Quotes

Where there is a double quote in your formula, put another one, thus:

="SUM(IF('Data from Prc Qry'!$G$2:$G$15000=J$1,IF('Data
from Prc Qry'!$E$2:$E$15000=$A2,'Data from Prc Qry'!
$K$2:$K$15000,0),0))/COUNTIF('Data from Prc Qry'!
$A$2:$A$15000,$A2&"" ""&TEXT(J$1,""mm/dd/yyyy""))"


"Ed" wrote in message ...
I'm trying to write a formula into a cell using VBA. The
formula has quotes in it and this is causing me
problems. Can anyone convert the below 'formula' into
VBA code so that it will work?

activecell.formulaArray =

"SUM(IF('Data from Prc Qry'!$G$2:$G$15000=J$1,IF('Data
from Prc Qry'!$E$2:$E$15000=$A2,'Data from Prc Qry'!
$K$2:$K$15000,0),0))/COUNTIF('Data from Prc Qry'!
$A$2:$A$15000,$A2&" "&TEXT(J$1,"mm/dd/yyyy"))"

You might notice that this is an array formula - will
this use of double quotes still work as such?