Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel - putting a formula with quotation marks into a cell 2

Status
Not open for further replies.

MrDougJ

Technical User
Feb 25, 2009
8
US
Hi,
I am trying to get the following formula to write to a cell but getting errors due to the quotation marks. I am vaguely aware of the Chr(34) option, but cant seem to get this to work either. Can anyone help me please?

Sheets("Data").Range("F4").Value = "=SUMPRODUCT(('All LES'!$C$2:$C$10000='All Records'!$A4)*('All LES'!$S$2:$S$10000="ABC")*('All LES'!$H$2:$H$10000="The 1st LES"))"

Thanks
 
Perhaps this ?
Sheets("Data").Range("F4").Formula = "=SUMPRODUCT(('All LES'!$C$2:$C$10000='All Records'!$A4)*('All LES'!$S$2:$S$10000="ABC")*('All LES'!$H$2:$H$10000=""The 1st LES""))"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Just double up the double quotes:
Code:
Sheets("Sheet1").Range("F4").Value = "=SUMPRODUCT(('All LES'!$C$2:$C$10000='All Records'!$A4)*('All LES'!$S$2:$S$10000=""ABC"")*('All LES'!$H$2:$H$10000=""The 1st LES""))"
Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Not as fast as PHV... [sad]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Yeah, but with fewer mistakes :)

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Hi PHV,

... 'All LES'!$S$2:$S$10000="ABC" ...
... you forgot to double up the quotes around the ABC.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
OK guys, thanks all of you for your help - I've got the issue resolved now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top