ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   formulas including ; character (https://www.excelbanter.com/excel-programming/294096-formulas-including-%3B-character.html)

Tomasz Lelek

formulas including ; character
 
Hello, I encouterd problem (Aplication defined or object defined error)
while trying to insert formula from macro to newly created template
worksheet. Problem occurs not always, but with formulas including character
";", like IF(a;b;c). Code line looks like this one:
Cells(1, 1).Formula = "=IF(C30;1;0)", and it doesnt matter if I put value
or ommit formula expression.
Please help.



Niek Otten

formulas including ; character
 
The ";" character is a local list separator. The international list
separator is "',". So either use

Cells(1, 1).Formula = "=IF(C30,1,0)"

or

Cells(1, 1).FormulaLocal = "=IF(C30;1;0)"

but this depends on the local version of your "IF" formula

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Tomasz Lelek" wrote in message
...
Hello, I encouterd problem (Aplication defined or object defined error)
while trying to insert formula from macro to newly created template
worksheet. Problem occurs not always, but with formulas including

character
";", like IF(a;b;c). Code line looks like this one:
Cells(1, 1).Formula = "=IF(C30;1;0)", and it doesnt matter if I put value
or ommit formula expression.
Please help.






All times are GMT +1. The time now is 12:26 PM.

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