Hi,
I can anybody help me..
I am struggling to detect arabic text from cell..
I am writing a program to detect the arabic numbers from alphanumeric arabic text.
unfortunately i am unable to get it.
if the cell is consist of only arabic numbers then i can get it, but if the value in cell is alphanumeric
then it is consider whole as char.
Program is :
Sub ReverseText()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
xValue = Rng.Value
xValue = " " & xValue
xLen = VBA.Len(xValue)
xOut = ""
yOut = ""
'Trying to reverse the arabic char
For i = 1 To xLen
getchar = VBA.Right(xValue, 1)
'Checking if String contain numbers or not
If IsNumeric(getchar) Then
xValue = VBA.Left(xValue, xLen - i)
yOut = getchar & yOut
'If not numers then check for decimal point
Else
If getchar = "." Then
xValue = VBA.Left(xValue, xLen - i)
yOut = getchar & yOut
'xOut = xOut & yOut
getchar = ""
'If not numbers then check for char other than numbers
Else
xValue = VBA.Left(xValue, xLen - i)
xOut = xOut & yOut
xOut = xOut & getchar
yOut = ""
End If
End If
Next
Rng.Value = xOut
Next
End Sub
--------------------------------------------------------------------------------------------------------------------------------------
Value in cell is : ARABIAN COLA CAN 355ML X 20
after running program output should be : 20 X LM355 NAC ALOC NAIBARA
this is in english, and working properly.
now in arabic
value in cell is :
* |
and output by this program :
* |
alphabets are reversing properly, but numbers also, which should not be.
i need the output same like english text one. but program is not detecting arabic number.
I am using excel2011 mac.
i tried in windows 7 also but there also same problem.
can anybody help me out. i need help urgently..
thanks,
Snehal