Forum Discussion
valentingiaufer
Oct 18, 2023Copper Contributor
Automatically added @ in formulas
Hello I want to add a formula in my cell: =SheetNameFunc()&""-""&ANNEE(AUJOURDHUI())&""-""&MOIS(AUJOURDHUI()) But each time the formula is added in the cell, excel automatically add...
- Oct 19, 2023
The Formula property expects a formula in English. You could use
ThisWorkbook.Sheets(SheetName).Range("H1").Formula = "=TEXTJOIN(""-"",,""Export"",SheetNameFunc(),YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))
To specify it in your local language, use FormulaLocal:
ThisWorkbook.Sheets(SheetName).Range("H1").FormulaLocal = "=JOINDRE.TEXTE(""-"";;""Export"";SheetNameFunc();ANNEE(AUJOURDHUI());MOIS(AUJOURDHUI());JOUR(AUJOURDHUI()))
valentingiaufer
Oct 19, 2023Copper Contributor
Thanks for your reply,
I tried to use the joindre method like this:
ThisWorkbook.Sheets(SheetName).Range("H1").Formula = "=JOINDRE.TEXTE(""-"";;""Export"";SheetNameFunc();ANNEE(AUJOURDHUI());MOIS(AUJOURDHUI());JOUR(AUJOURDHUI()))"
But it raises the 1004 error code : Application-defined or object-defined error
Do you think about a solution that can resolve my problem ?
HansVogelaar
Oct 19, 2023MVP
The Formula property expects a formula in English. You could use
ThisWorkbook.Sheets(SheetName).Range("H1").Formula = "=TEXTJOIN(""-"",,""Export"",SheetNameFunc(),YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))
To specify it in your local language, use FormulaLocal:
ThisWorkbook.Sheets(SheetName).Range("H1").FormulaLocal = "=JOINDRE.TEXTE(""-"";;""Export"";SheetNameFunc();ANNEE(AUJOURDHUI());MOIS(AUJOURDHUI());JOUR(AUJOURDHUI()))
- Tina_GaoOct 23, 2023Copper Contributor
I have the same problem, each time I re-opened this file, '@' is automatically added to the below formulas, would you please suggest a solution? Thanks a lot! HansVogelaar
=TEXTJOIN(" ",TRUE," WRITE-VARS",IF(@H10:H502<>"",G10:G502,""))
=IFERROR(@INDEX('Aspen Data In'!D:D,SMALL(IF(@'Aspen Data In'!D$3:D$800<>"",@ROW($3:$800)),ROW('Aspen Data In'!D1))),"")
- HansVogelaarOct 24, 2023MVP
Sorry, no idea. I cannot reproduce the problem.
- valentingiauferOct 19, 2023Copper ContributorIt works !!!!
Thank you so much 🙂
Have a great day !- HansVogelaarOct 19, 2023MVP
Credits go to PeterBartholomew1