+ Reply to Thread
Results 1 to 4 of 4

Recognising months given in a local language

  1. #1
    Registered User
    Join Date
    01-29-2024
    Location
    Amsterdam
    MS-Off Ver
    365
    Posts
    24

    Recognising months given in a local language

    While reading the contents of a text file in VBA, I came across a date “31/OCT/2023”. The language of the report is recognised (form example, sometimes also 28/FEV/2023 for French reports)

    I know that I can manipulate the date in local language from a date perspective using a worksheet function TEXT. For example, I can change the string “31/OKT/2023” (Dutch) to 31 October 2023
    (English) using
    Please Login or Register  to view this content.
    .

    However, due to my language settings Excel does not recognise “OCT” as a valid month. DateValue(“31/OCT/2023”) gives an error (invalid type).
    I can off course create a custom function that includes all months for the report languages I process, but I was wondering if Excel or VBA also provided a standard function or method to a reverse lookup of a date string that is provided in another language (which is recognised based on other strings in the source report) to the language setting of Excel.

    Anyone has an idea?

    Art

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Recognising months given in a local language

    You could use this for Dutch:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Or for Portuguese:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Or you could use a formula like this one to see the months in many languages:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DJunqueira; 03-20-2024 at 08:38 AM.

  3. #3
    Registered User
    Join Date
    01-29-2024
    Location
    Amsterdam
    MS-Off Ver
    365
    Posts
    24

    Re: Recognising months given in a local language

    I know this, but this isn't solving my issue. The problem is that my source string is not recognised by Excel because it contains a month value in a language that is not the same as the language setting in my excel version (for example "OCT" or "MAY"). Thus, before Excel can process this as part of a date (month) I should be able to include in which language the month is provided. Hence my question, because this is a reverse solution as the objective of the "TEXT" formula.

  4. #4
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Recognising months given in a local language

    You could create a LAMBDA function (DateTranslator) to translate dates.

    DateTranslator
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Could do the same with macro, but some places you can't use it.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Months Appear In A Different Language On Pivot Charts
    By zanshin777 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-06-2020, 09:28 AM
  2. [SOLVED] Request to get date in local language, syntax error
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2017, 07:10 AM
  3. [SOLVED] From local language to english
    By olwy in forum Non English Excel
    Replies: 6
    Last Post: 03-03-2014, 06:42 AM
  4. [SOLVED] Boolean in VBA are returned in local language
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2013, 07:22 AM
  5. Real time text translation to match the language selectedin language vailidation
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2013, 09:23 PM
  6. Replies: 2
    Last Post: 03-14-2006, 05:45 AM
  7. Language of the local PC
    By Patrick Fredin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2005, 11:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1