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!
Bookmarks