View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gizmo63 Gizmo63 is offline
external usenet poster
 
Posts: 43
Default Quote Marks Through VBA

By far the simplest way is to double up the quotes, so the code looks like
this:

Range([range to insert formula]) = "=IF(Sheet2!G6=""Maturity"",1,2)"

HTH

Giz

" wrote:

Very simple question, but I can't figure it out:

I want to make a formula in a cell through VBA, but I want the formula
to have a word in it (which needs to be in quotes). That is, I want
the formula to read:

=IF(Sheet2!G6="Maturity",1,2)

How can I get the Maturity part surrounded by quotes?

Thanks!

Brett