ThomasLafferty
Instructor
Hi!
I'm using VBA to write a formula to a cell via range. The formula string must be enclosed in double quotes, however the formula itself is examining text values which must be enclosed in quotes. Doing this causes VBA to treat the first quote of the text values as being the end of the statement. How should I do this?
Thanks!
Tom
Born once die twice; born twice die once.
I'm using VBA to write a formula to a cell via range. The formula string must be enclosed in double quotes, however the formula itself is examining text values which must be enclosed in quotes. Doing this causes VBA to treat the first quote of the text values as being the end of the statement. How should I do this?
Code:
Range("T12").FormulaR1C1 = "=IF(OR(LEFT(H12,2)="HD",LEFT(H12,2)="CL"," _
& "LEFT(H12,3)=''THD'',H12=0),0,HLOOKUP(S12,PricingTable,T12,FALSE))"
Thanks!
Tom
Born once die twice; born twice die once.