[VBA] [excel] An error occurred while using 'Japanese - Katakana' in 'inStr'

I am an analyst with Korean data. I used the Korean version of Windows 7 and OS.

I have a problem with instrin VBA (Excel). In the normal case, it instrgenerates the exact number in "C2" indicating the number of the starting point in the string "A2"

Here is a normal sample: Alphabet

Even Koreans and Japanese (hiragana) also have no problems. I'm sorry, I can’t try anymore because I do not have enough reputation on this site.

But there is always a mistake when I use Japanese katakana. The error message is below the suggestion.

'7' runtime error occurred, insufficient memory

Refer to this sample: Error Case - Japanese - (Katakana)

, , .

, - .

+4
1

Excel Excel 2013/Win7.

, ​​ excel, , , .

  • , "InStr" "InStrb" , .
Sub instr()
Range("C2") = InStrB(1, Range("A2"), Range("B2"), 1)
End Sub
  1. StrConv (string, vbUnicode), InStr.
Sub instr()
Range("C2") = InStr(1, StrConv(Range("A2"), vbUnicode), StrConv(Range("B2"), vbUnicode), 1)
End Sub

, , . ( , , . - .)

0

Source: https://habr.com/ru/post/1685441/


All Articles