PDA

View Full Version : Sleeper: Filter Languages Charactor Eng/Rus



r_know
07-09-2012, 12:31 PM
Dear All,

I have "D" column, which having randomly English and Russian sentences. They are up to 2300 rows.I want separate them Eng and Russian by Filter or any commands.

Please assist to solve this thread.

Regards,

RL>

CodeNinja
07-10-2012, 12:11 PM
I am thinking that Cyrillic characters have an ASCII value greater than 128... so something like the following should manipulate Russian words...

this code just moves Russian words to column 2, but you could do whatever you want with it once you identify it...

Hope this helps.


Sub test()
Dim str As String
Dim lRow As Long
Dim lStr As Long
Dim bRussian As Boolean
For lRow = 1 To Sheet1.Range("A65536").End(xlUp).Row
bRussian = False
str = Sheet1.Cells(lRow, 1)
For lStr = 1 To Len(str)
If Asc(Mid(str, lStr, 1)) > 128 Then bRussian = True
Next lStr
If bRussian Then
Sheet1.Cells(l, 2) = Sheet1.Cells(l, 1)
End If
Next lRow
End Sub