View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Quote Marks Through VBA

I put them in explicitly thru chr():


Sub brett()
Dim s As String
s = "=IF(Sheet2!G6=" & Chr(34) & "Maturity" & Chr(34) & ",1,2)"
Cells(1, 1).Formula = s
End Sub

--
Gary's Student


" 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