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()))
HansVogelaar
Oct 18, 2023MVP
What does SheetNameFunc return?
- valentingiauferOct 19, 2023Copper ContributorThe name of the Activesheet where the sub is called
- HansVogelaarOct 19, 2023MVP
Thanks. I'm afraid I don't know what causes the problem; I hope that someone else will have a helpful suggestion for you.
- valentingiauferOct 19, 2023Copper ContributorIs it the right way to get the year and month or is there an other way that could help ?