ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quotes in Macro Formula (https://www.excelbanter.com/excel-programming/354855-quotes-macro-formula.html)

Shorty[_3_]

Quotes in Macro Formula
 
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?


Ardus Petus

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

"Shorty" a écrit dans le message de
ups.com...
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?




Tom Ogilvy

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

double quotes within quotes

--
Regards,
Tom Ogilvy


"Shorty" wrote in message
ups.com...
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?




Bob Phillips[_6_]

Quotes in Macro Formula
 
No need for concatenate

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

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Shorty" wrote in message
ups.com...
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?




Shorty[_3_]

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



All times are GMT +1. The time now is 07:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com