Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
formulas in code error
I am trying to write a macro and came across this error
range("d2").formula = "=text(c2,"yyyy")" It keeps saying that the end statement for the "yyyy" is wrong? I don't know if it is because of all the "s or what? How do I get around this problem of inserting formulas in the code itself? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
formulas in code error
if you want to assign a quoted argument
you'll have to use double qoutes in vba.. range("d2").formula = "=text(c2,""yyyy"")" keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Kou Vang" wrote: I am trying to write a macro and came across this error range("d2").formula = "=text(c2,"yyyy")" It keeps saying that the end statement for the "yyyy" is wrong? I don't know if it is because of all the "s or what? How do I get around this problem of inserting formulas in the code itself? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
formulas in code error
Hi
make this range("d2").formula = "=text(c2,""yyyy"")" -- Regards Frank Kabel Frankfurt, Germany Kou Vang wrote: I am trying to write a macro and came across this error range("d2").formula = "=text(c2,"yyyy")" It keeps saying that the end statement for the "yyyy" is wrong? I don't know if it is because of all the "s or what? How do I get around this problem of inserting formulas in the code itself? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
formulas in code error
Hi Kou,
Use double double quotes. As in: Range("d2").Formula = "=text(c2,""yyyy"")" HTH Peter Beach "Kou Vang" wrote in message ... I am trying to write a macro and came across this error range("d2").formula = "=text(c2,"yyyy")" It keeps saying that the end statement for the "yyyy" is wrong? I don't know if it is because of all the "s or what? How do I get around this problem of inserting formulas in the code itself? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error in this code | Excel Worksheet Functions | |||
Error Code 481 | Excel Discussion (Misc queries) | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming | |||
Code or formulas, not sure which | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |