Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
Hi All,
I wanted to get the Hungarian name of months in VBA in my Hungarian version with the following statement: monthname = WorksheetFunction.Text(DateSerial(1900, monthnum, 1), "mmmm") It returned the English month names. My Windows language setting is right (Hungarian), =Szöveg(Dátum(1900; monthnum; 1); "hhhh") which is Hungarian translation of =Text(Date(1900, monthnum, 1), "mmmm") in my Excel 2000 returns the right Hungarian month names. How can I get Hungarian month names in VBA? Thanks, Stefi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
On Fri, 18 Nov 2005 08:09:27 -0800, "Stefi"
wrote: Hi All, I wanted to get the Hungarian name of months in VBA in my Hungarian version with the following statement: monthname = WorksheetFunction.Text(DateSerial(1900, monthnum, 1), "mmmm") It returned the English month names. My Windows language setting is right (Hungarian), =Szveg(Dtum(1900; monthnum; 1); "hhhh") which is Hungarian translation of =Text(Date(1900, monthnum, 1), "mmmm") in my Excel 2000 returns the right Hungarian month names. How can I get Hungarian month names in VBA? Thanks, Stefi Are these correct? janur februr mrcius prilis mjus jnius jlius augusztus szeptember oktber november december If so, try using the VBA Format function. I generated the above using my US version of excel, with the Windows regional setting set to Hungarian, and the following code: --------------------- Sub foo() Dim monthnum As Integer For monthnum = 1 To 12 Debug.Print Format(DateSerial(2005, monthnum, 1), "mmmm") Next monthnum End Sub --------------------- The Format function is supposed to be locale aware. I don't know why the worksheetfunction.text doesn't work. --ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
Hi Stefi
Look in the VBA help for Application.International -- Regards Ron de Bruin http://www.rondebruin.nl "Stefi" wrote in message ... Hi All, I wanted to get the Hungarian name of months in VBA in my Hungarian version with the following statement: monthname = WorksheetFunction.Text(DateSerial(1900, monthnum, 1), "mmmm") It returned the English month names. My Windows language setting is right (Hungarian), =Szveg(Dtum(1900; monthnum; 1); "hhhh") which is Hungarian translation of =Text(Date(1900, monthnum, 1), "mmmm") in my Excel 2000 returns the right Hungarian month names. How can I get Hungarian month names in VBA? Thanks, Stefi |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
Thanks Ron, it works, but it's not clear for me, why does format code "mmmm"
have different meanings in Text and Format functions? Regards, Stefi Ron Rosenfeld ezt *rta: On Fri, 18 Nov 2005 08:09:27 -0800, "Stefi" wrote: Hi All, I wanted to get the Hungarian name of months in VBA in my Hungarian version with the following statement: monthname = WorksheetFunction.Text(DateSerial(1900, monthnum, 1), "mmmm") It returned the English month names. My Windows language setting is right (Hungarian), =Szöveg(Dátum(1900; monthnum; 1); "hhhh") which is Hungarian translation of =Text(Date(1900, monthnum, 1), "mmmm") in my Excel 2000 returns the right Hungarian month names. How can I get Hungarian month names in VBA? Thanks, Stefi Are these correct? január február március április május június július augusztus szeptember október november december If so, try using the VBA Format function. I generated the above using my US version of excel, with the Windows regional setting set to Hungarian, and the following code: --------------------- Sub foo() Dim monthnum As Integer For monthnum = 1 To 12 Debug.Print Format(DateSerial(2005, monthnum, 1), "mmmm") Next monthnum End Sub --------------------- The Format function is supposed to be locale aware. I don't know why the worksheetfunction.text doesn't work. --ron |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
On Sun, 20 Nov 2005 23:31:03 -0800, "Stefi"
wrote: Thanks Ron, it works, but it's not clear for me, why does format code "mmmm" have different meanings in Text and Format functions? Regards, Stefi VBA is said to be very US-centric. Excel and VBA are really two different programs. And I don't know enough about internationally compliant coding to be able to answer your question. I don't understand is why the application.worksheetfunction.text, when used in VBA with the "hhhh" coding, (on a machine with Hungarian regional settings) doesn't work in VBA. --ron |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
As far as I experienced there are inconsistencies in the way VBA coding is
adjusted to regional settings, e.g. if one records a formula-entering macro in Hungarian, say =SZÖVEG(MA();"hhhh") the VBA code result will be ActiveCell.FormulaR1C1 = "=TEXT(TODAY(),""hhhh"")" where the function names are translated but "hhhh" coding remains Hungarian. Never mind, I'm glad about that you found the right path in this jungle! Regards, Stefi Ron Rosenfeld ezt *rta: On Sun, 20 Nov 2005 23:31:03 -0800, "Stefi" wrote: Thanks Ron, it works, but it's not clear for me, why does format code "mmmm" have different meanings in Text and Format functions? Regards, Stefi VBA is said to be very US-centric. Excel and VBA are really two different programs. And I don't know enough about internationally compliant coding to be able to answer your question. I don't understand is why the application.worksheetfunction.text, when used in VBA with the "hhhh" coding, (on a machine with Hungarian regional settings) doesn't work in VBA. --ron |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of month in national language
On Mon, 21 Nov 2005 04:29:04 -0800, "Stefi"
wrote: As far as I experienced there are inconsistencies in the way VBA coding is adjusted to regional settings, e.g. if one records a formula-entering macro in Hungarian, say =SZVEG(MA();"hhhh") the VBA code result will be ActiveCell.FormulaR1C1 = "=TEXT(TODAY(),""hhhh"")" where the function names are translated but "hhhh" coding remains Hungarian. Never mind, I'm glad about that you found the right path in this jungle! Regards, Stefi "Onward through the fog" --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Indirect function with national language | Excel Worksheet Functions | |||
National language function names | Excel Worksheet Functions | |||
date format code in national language version | Excel Discussion (Misc queries) | |||
language support in excel sheet using a third party language tool | Excel Worksheet Functions | |||
Constants & Declarations for National Language Support | Excel Programming |