Quotes in Macro Formula

S

Shorty

Hi
this should be a quick one! im trying to put a formula in a cell ie
ActiveCell.Formula = "=CONCATENATE(TEXT(A1,"yyyy/mm/dd"))"

However as i have to put double quotes in for the date format excel
thinks it is at the end of the line, how can i put in the double quotes
without this happening?

ActiveCell.Formula = "=CONCATENATE(TEXT(A1," & chr0022 & "yyyy/mm/dd"
& chr0022 & "))"

or something like this?
 
A

Ardus Petus

ActiveCell.Formula = "=CONCATENATE(TEXT(A1,""yyyy/mm/dd""," something to
concatenate with))"
 
T

Tom Ogilvy

ActiveCell.Formula = "=CONCATENATE(TEXT(A1,""yyyy/mm/dd""))"

double quotes within quotes
 
B

Bob Phillips

No need for concatenate

ActiveCell.Formula = "=TEXT(A1,""yyyy/mm/dd"")"

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
S

Shorty

Thanks guys ive removed the concatenate (from a previous used formula,
doh!) and the double quotes are working great!
Thanks again,
Shorty
 

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