Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TEXT(Cell1,"MMMM YYYY") to work in all locale.
You could use VBA to create the correct function:
This has not been tested with other regional formats, but works with my Canadian settings. It's kind of awkward, but I don't know of any other way to do this. Sub SetFormula() Dim strM As String Dim strY As String Dim strFormat As String Dim strDQ As String strDQ = Chr(34) strM = Application.International(xlMonthCode) strY = Application.International(xlYearCode) strFormat = strM & strM & strM & strM & " " & strY & strY & strY & strY ActiveSheet.Range("B2").Formula = _ "=" & strDQ & "Month :- " & strDQ & _ " & TEXT($A$2, " & strDQ & strFormat & strDQ & ")" End Sub -- HTH, Dianne In , Kevin McCartney typed: Hi TWIMC 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. The letter that represents Y for Year in German is J for Jahr, so I know it relates to the locale. My question is that if Excel is locale supportive in that the IF function is translated WENN or VLOOKUP is translated to SVERWIES then how come it does not translate text formats like MMMM YYYY and translate them automatically to MMMM JJJJ. In any case how do I overcome this problem. (English settings) ="Month :- " & TEXT($A$2,"MMMM YYYY") where A2 = 01/01/2004 I would see Month :- " January 2004" (German settings) ="Month :- " & TEXT($A$2,"MMMM YYYY") where A2 = 01.01.2004 I would see Month :- " Januar YYYY" TIA KM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combine text & date formula to show mmmm dd, yyyy? | Excel Worksheet Functions | |||
How to change "xxx CR" and "y,yyy DB" to "+xxx" and "-yyyy" | Excel Worksheet Functions | |||
Convert text "date" (DDMMMYY) to datetime value of YYYY-MM-DD - ho | Excel Discussion (Misc queries) | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) | |||
TEXT(Cell1,"MMMM YYYY") to work in all locale. | Excel Programming |