Results 1 to 2 of 2

VBA Korean translation to english

Threaded View

  1. #1
    Registered User
    Join Date
    02-29-2024
    Location
    Malaysia
    MS-Off Ver
    2312
    Posts
    1

    VBA Korean translation to english

    Hey folks,

    I would like to ask is there any way to convert korean words into english in vba code?

    Currently, i'm working on the rows that meet criteria which the leave types are under unpaid category will be filtered out but the all the leave types are in korean.

    although i have used unicode to convert but still not working, the korean word is "난임치료휴가", the vba code is as below:

    Sub TranslateUnicodeToEnglish()
        Dim unicodeValues As String
        Dim translatedText As String
        Dim utf32Value As Long
    
        ' Assign Unicode values
        unicodeValues = "B098C778CE58D6C4AC00"
    
        ' Translate each Unicode value to English
        For i = 1 To Len(unicodeValues) Step 4
            ' Convert the hexadecimal Unicode value to decimal
            utf32Value = CLng("&H" & Mid(unicodeValues, i, 4))
            
            ' Check if the character is outside the BMP
            If utf32Value >= &H10000 Then
                ' Convert to UTF-16 surrogate pairs
                utf32Value = utf32Value - &H10000
                translatedText = translatedText & ChrW(&HD800 + (utf32Value \ &H400)) & ChrW(&HDC00 + (utf32Value Mod &H400))
            Else
                ' Characters within the BMP
                translatedText = translatedText & ChrW(utf32Value)
            End If
        Next i
    
        ' Display the result
        MsgBox "Translated Text: " & translatedText
    End Sub
    Please share if u have the solution

    Thanks!
    Last edited by AliGW; 03-01-2024 at 05:21 AM. Reason: Code tags added - please review the forum guidelines.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. remove all except a-z, korean characters and spaces
    By JossMedina in forum Excel General
    Replies: 2
    Last Post: 05-13-2020, 04:42 AM
  2. Possible bug in the English to Portuguese translation
    By jpmath in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-30-2013, 07:49 AM
  3. terrible non-english translation of forum rules
    By L-Drr in forum Suggestions for Improvement
    Replies: 12
    Last Post: 10-02-2013, 11:23 AM
  4. Code Translation into simple English
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2013, 02:55 PM
  5. English application compatible with Korean
    By kadams99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-16-2009, 02:13 PM
  6. trouble opening a korean slk
    By rabbitspazz in forum Excel General
    Replies: 1
    Last Post: 11-16-2007, 10:55 PM
  7. [SOLVED] Translation from english to another language
    By Ronald in forum Excel General
    Replies: 2
    Last Post: 06-30-2006, 04:45 AM

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