ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TEXT(Cell1,"MMMM YYYY") to work in all locale. (https://www.excelbanter.com/excel-programming/290838-re-text-cell1-mmmm-yyyy-work-all-locale.html)

arno

TEXT(Cell1,"MMMM YYYY") to work in all locale.
 
Hi Kevin,

The following funtion works on a computer that has "English" date format

setting each YYYY to represent a four digit year, but if view the same
workbook on a computer that has "German" settings I don't see a four digit
year I only see YYYY.

sorry, there's no simple solution. "YYYY" is "hardcoded" in your function
and it will not be translated.

what you can do:

you have a date in A1, in A2 you write your desired textformat eg. MM JJJJ
(just type in the text). In A3 use the formula
=text(a1, a2) which will give you the correct result.

now, you should let the user select his language in a dropdown-menu (forms
toolbar). Based on this selection you set the value of A2 to MM JJJJ or MM
YYYY or whatever you like.

This is what you do for all your hardcoded formats, and in your formulas you
refer to the cells like A2.

Best regards

arno





All times are GMT +1. The time now is 02:25 AM.

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