ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Double Quotes (https://www.excelbanter.com/excel-programming/287634-double-quotes.html)

ed

Double Quotes
 
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?

John Tjia

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?



All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com