Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Convert Traditional Chinese to Simplified Chinese in VBA?
Convert Traditional Chinese to Simplified Chinese in VBA?

Sub uv Traditional and Simplified()

Dim i As Long, r As Long

r = Range("u" & Rows.Count).End( xlUp).Row

For i = 1 To r

Range("u" & i).Value = T_S_Cvt(Range("u" & i).Text)

Next i

r = Range("v" & Rows.Count).End(xlUp).Row

For i = 1 To r

Range("v" & i).Value = T_S_Cvt(Range("v" & i).Text)

Next i

End Sub

< p>Public Function T_S_Cvt(strData, Optional bytOption As Byte = 1) As String

With CreateObject("Word.Document")

.Content = strData

.Range.TCSCConverter bytOption, True, True

T_S_Cvt = .Content

.Close False

End With

End Function< /p>