Forum Discussion
Isty_Ahmad
Aug 02, 2022Copper Contributor
How to find/replace Japanese characters in Excel VBA code
Hi, Looking for some help please in how to find/replace japanese characters with VBA in Excel. I basically have a monthly report i get in a mixture of Japanese Shift format and English, and I can...
- Aug 02, 2022
Sub japanese() Dim var As Variant Dim i As Long Dim j As Integer Dim maxrow As Long Application.ScreenUpdating = False Range("B:B").Clear maxrow = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To maxrow If Not IsEmpty(Cells(i, 1)) Then var = Application.Match(Cells(i, 1), Range("E1:E50"), 0) If Not IsError(var) Then j = Application.Match(Cells(i, 1), Range("E1:E50"), 0) Cells(i, 2).Value = Cells(j, 6).Value Else End If Else End If Next i Application.ScreenUpdating = True End Sub
Maybe with this code. In the attached file you can click the button in cell H2 to run the code. In the example the words and translation are entered in range E1:F50. The vocabulary to be translated is in column A.
OliverScheurich
Aug 02, 2022Gold Contributor
Sub japanese()
Dim var As Variant
Dim i As Long
Dim j As Integer
Dim maxrow As Long
Application.ScreenUpdating = False
Range("B:B").Clear
maxrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To maxrow
If Not IsEmpty(Cells(i, 1)) Then
var = Application.Match(Cells(i, 1), Range("E1:E50"), 0)
If Not IsError(var) Then
j = Application.Match(Cells(i, 1), Range("E1:E50"), 0)
Cells(i, 2).Value = Cells(j, 6).Value
Else
End If
Else
End If
Next i
Application.ScreenUpdating = True
End Sub
Maybe with this code. In the attached file you can click the button in cell H2 to run the code. In the example the words and translation are entered in range E1:F50. The vocabulary to be translated is in column A.
Isty_Ahmad
Aug 08, 2022Copper Contributor
Really clever idea - thank you so much - will try that approach ! 🙂