Get current culture using just formula for localization purpose

三世轮回 提交于 2019-12-06 10:52:07

No, there is no way to get system language settings without VBA. There is simply no built-in function for this. But if you consider UDF, there's a solution:

Public Function GetLang()
    GetLang = Application.LanguageSettings.LanguageID(msoLanguageIDUI)
End Function

However, with your help we have found a trick. You can guess the system language by analyzing formula text (only in Excel 2013):

A1=TODAY()
=IF(FORMULATEXT(A1)="=TODAY()",[some logic for English system],[some logic for non-English system])

Or by analyzing local month name:

=IF(TEXT(1,"mmmm")="January",[some logic for English system],[some logic for non-English system])
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!