quotes in formulas using vba

D

Doug Broad

I want to enter the following formula into cell a5

=SUBSTITUTE(F3," ","")

I tried this:

range("a5").value= "=substitute(f3,""" ""","""""")"

I get an error when I try to do this
Expected end of statement

I get lost in the quotes. What is the process of translation?

Thanks
 
L

Laura Cook

You have too many quotes, try the following:

Range("A5").Value = "=SUBSTITUTE(F3,"" "","""")"
 
D

Doug Broad

Thanks Laura!
That worked. So does the outer pair of quotes
for each quoted section allow the inner set to show
up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top