Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indirect function with national language catherine Excel Worksheet Functions 7 February 24th 10 02:27 PM
National language function names Stefi Excel Worksheet Functions 2 July 20th 09 02:49 PM
date format code in national language version Stefi Excel Discussion (Misc queries) 4 July 21st 08 09:18 AM
language support in excel sheet using a third party language tool seema Excel Worksheet Functions 0 March 13th 06 06:06 AM
Constants & Declarations for National Language Support Raul[_4_] Excel Programming 2 April 2nd 04 10:42 PM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"