BAHTTEXT CHANGE IN TO ENGLISHTEXT IN EXCEL

0

BAHTTEXT(number)
Number is a number you want to convert to text, or a reference to a cell
containing a number, or a formula that evaluates to a number

Converts a number to Thai text

In Microsoft Excel for Windows, you can change the Baht format to a
different style by using Regional Settings or Regional Options in Control
Panel.
In Excel for the Macintosh, you can change the Baht number format to a
different style by using Control Panel for Numbers.

I try to change Thai text to English Text however I can't Change the text

Please assist me on Changing the Test from Thai to English.

how can change the BAHTTEXT formula in ENGLISHTEXT..?

PLZ HELP ME.

Answer
Discuss

Answers

0

There is not going to be any 'nice' direct way to do this. You could use some vba to make this conversion in a rather ugly and slow way though.

I found this piece of code somewhere (don't remember) that acts as a basic call to a web page (google translate) to do the conversion and then returns the result.

Function transalte_using_vba(str) As String
    Dim IE As Object, i As Long
    Dim inputstring As String, outputstring As String, text_to_convert As String, result_data As String, CLEAN_DATA

    Set IE = CreateObject("InternetExplorer.application")
    '   TO CHOOSE INPUT LANGUAGE

    inputstring = "auto"

    '   TO CHOOSE OUTPUT LANGUAGE

    outputstring = "es"

    text_to_convert = str

    'open website

    IE.Visible = False
    IE.navigate "http://translate.google.com/#" & inputstring & "/" & outputstring & "/" & text_to_convert

    Do Until IE.ReadyState = 4
        DoEvents
    Loop

    Application.Wait (Now + TimeValue("0:00:5"))

    Do Until IE.ReadyState = 4
        DoEvents
    Loop

    CLEAN_DATA = Split(Application.WorksheetFunction.Substitute(IE.Document.getElementById("result_box").innerHTML, "</SPAN>", ""), "<")

    For j = LBound(CLEAN_DATA) To UBound(CLEAN_DATA)
        result_data = result_data & Right(CLEAN_DATA(j), Len(CLEAN_DATA(j)) - InStr(CLEAN_DATA(j), ">"))
    Next


    IE.Quit
    transalte_using_vba = result_data


End Function

You can use the function in another macro like this:

Sub translate_macro()
transalte_using_vba("your text")
End Sub
Discuss

Answer the Question

You must create an account to use the forum. Create an Account or Login