Extract Arabic or English words

Geo Jul

Board Regular
Joined
Nov 19, 2022
Messages
125
Office Version
  1. 2016
Platform
  1. Windows
Dear ALL​
need help how to extract Arabic or English words from a list in excel 2010 or 2016​
many thanks in advance​
 

Attachments

  • Screenshot (932).png
    Screenshot (932).png
    33 KB · Views: 14

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Check is this works:
VBA Code:
Public Sub HighlightArabic()
  Dim cellCheck As Range
  Dim hasArabic As Boolean
  Dim i As Long, c As Long
  Dim lRow As Long
  Dim arabicList As Variant

  lRow = Cells(Rows.Count, "A").End(xlUp).Row
  Redim arabicList(1 To 1, 1 To 1)

  For Each cellCheck In Range("A1:A" & lRow)
    hasArabic = False
    For i = 1 To Len(cellCheck.Text)
        c = AscW(Mid(cellCheck.Text, i))
        If c >= &H600 And c <= &H6FF Then
            hasArabic = True
            Exit For
        End If
      Next i
      If hasArabic Then
        arabicList(1, Ubound(arabicList, 2)) = cellCheck.Value
        Redim Preserve arabicList(1 To 1, 1 To Ubound(arabicList, 2) + 1)
      End If
  Next
  Redim Preserve arabicList(1 To 1, 1 To Ubound(arabicList, 2) - 1)
  Range("B1").Resize(Ubound(arabicList, 2)).Value = Application.Transpose(arabicList)
End Sub
 
Upvote 0
Check is this works:
VBA Code:
Public Sub HighlightArabic()
  Dim cellCheck As Range
  Dim hasArabic As Boolean
  Dim i As Long, c As Long
  Dim lRow As Long
  Dim arabicList As Variant

  lRow = Cells(Rows.Count, "A").End(xlUp).Row
  Redim arabicList(1 To 1, 1 To 1)

  For Each cellCheck In Range("A1:A" & lRow)
    hasArabic = False
    For i = 1 To Len(cellCheck.Text)
        c = AscW(Mid(cellCheck.Text, i))
        If c >= &H600 And c <= &H6FF Then
            hasArabic = True
            Exit For
        End If
      Next i
      If hasArabic Then
        arabicList(1, Ubound(arabicList, 2)) = cellCheck.Value
        Redim Preserve arabicList(1 To 1, 1 To Ubound(arabicList, 2) + 1)
      End If
  Next
  Redim Preserve arabicList(1 To 1, 1 To Ubound(arabicList, 2) - 1)
  Range("B1").Resize(Ubound(arabicList, 2)).Value = Application.Transpose(arabicList)
End Sub
Many thanks for your responses. Please, if possible, provide a formula
 
Upvote 0
The below is not an exact science but as long as your text always starts with a letter then the below may help. One option to try for Excel 2013> and one for Excel 2000>:
Cell Formulas
RangeFormula
B2:B11B2=IF(OR(AND(UNICODE(LEFT(A2,1))>64,UNICODE(LEFT(A2,1))<98),AND(UNICODE(LEFT(A2,1))>89,UNICODE(LEFT(A2,1))<123)),"English","Not English")
C2:C11C2=IF(CODE(LEFT(A2,1))<>63,"English","Not English")
 
Last edited:
Upvote 1
The below is not an exact science but as long as your text always starts with a letter then the below may help. One option to try for Excel 2013> and one for Excel 2000>:
Cell Formulas
RangeFormula
B2:B11B2=IF(OR(AND(UNICODE(LEFT(A2,1))>64,UNICODE(LEFT(A2,1))<98),AND(UNICODE(LEFT(A2,1))>89,UNICODE(LEFT(A2,1))<123)),"English","Not English")
C2:C11C2=IF(CODE(LEFT(A2,1))<>63,"English","Not English")
Many Thanks for your help and your responses.
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,305
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top