Share via

VBA Specify language for Format function

Anonymous
2013-09-09T19:46:47+00:00

Hi,

In Excel, we can use an LCID code with the TEXT function to get the output in a specific language.  See http://excel.tips.net/T003299_Specifying_a_Language_for_the_TEXT_Function.html

e.g.

=TEXT(A1,"[$-409]mmmm, yyyy")

Is there an equivalent in VBA for the Format function?

CheersRich
Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2017-04-07T07:50:46+00:00

    Any solution on that?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-09-09T21:23:27+00:00

    I've used FORMAT in VBA before.  Have you tried that?

    Hi Barb,

    Have you used FORMAT with a language ID?

    ?FORMAT("1 Jan 2013","**[$-407]**mmmm, yyyy")

    returns:

        January, 2013

    but in Excel:

    =TEXT("1 Jan 2013","**[$-407]**mmmm, yyyy")

    returns:

        Januar, 2013

    which is correctly in German = 0407, see:

    http://excel.tips.net/T003299_Specifying_a_Language_for_the_TEXT_Function.html

    Cheers

    Rich

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-09-09T21:03:31+00:00

    I've used FORMAT in VBA before.  Have you tried that?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-09-09T20:51:19+00:00

    Thanks Hans.

    Thanks for confirming my expectations....

    As I'm doing this in PPT VBA, I guess I'll be opening an Excel Application to do this - oh well.

    Thanks again.

    Cheers

    Rich

    Was this answer helpful?

    0 comments No comments
  5. HansV 462.6K Reputation points
    2013-09-09T20:32:04+00:00

    No, but in Excel VBA, you can Application.WorksheetFunction.Text or Application.Text:

    MsgBox Application.Text(Range("A1"), "[$-415]mmmm, yyyy")

    or you can use Evaluate:

    MsgBox Evaluate("TEXT(A1, ""[$-415]mmmm, yyyy"")")

    Was this answer helpful?

    0 comments No comments