concatenate a double-quote

J

Jack Deuce

Trying to create a text string with ". The best I can do is generate
a single-quote and then find/replace the single for a double-quote. I
also tried using chr(34).

I want to create a text sring from two cells in Excel.
="copy "&A2&" "&$A$1

I'd like the result to be==> copy "f:\file" "l:\directory" <==
generating the double-quotes before and after the filename and
directory.

Thanks.
 
S

smartin

Jack said:
Trying to create a text string with ". The best I can do is generate
a single-quote and then find/replace the single for a double-quote. I
also tried using chr(34).

I want to create a text sring from two cells in Excel.
="copy "&A2&" "&$A$1

I'd like the result to be==> copy "f:\file" "l:\directory" <==
generating the double-quotes before and after the filename and
directory.

Thanks.

The unintuitive answer is to use quadruple quotes:

="copy " & """" &A2& """" & " " & """" &$A$1& """"

You could also place " in a cell and refer to that instead of the
quad-quotes.
 
J

Jack Deuce

thanks.

The unintuitive answer is to use quadruple quotes:

="copy " & """" &A2& """" & " " & """" &$A$1& """"

You could also place " in a cell and refer to that instead of the
quad-quotes.
 

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