View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Turtle_Todd Turtle_Todd is offline
external usenet poster
 
Posts: 1
Default Using Text in a Formula or FormulaR1C1 property

I want to use a logical if statement checking a text word in a formula
statement.

I want programmatically to create the cell
=IF(A1="apples","Yes","No")

However, when I enter
Range("B1").Formula="=IF(A1="apples","Yes","No")"

in VB the quotes mess this all up. The single quotes don't work either
Range("B1").Formula="=IF(A1='apples','Yes','No')"

Any ideas?