Oh
Finally I got it
Change the Mid(tempstr,b,1) to Mid(tempstr,1,1)
It works as I hoped
anyway thanks
Hi All
I'm new here and I hope you help me
I have a code to find a certain letter in Arabic and replace it with another letter
my code finds every letter ( أ , إ , آ ) and replace it with ( ا )
the problem is that the code replaces every letter in the text and what I need is to replace the first letter only if it 's one of those assigned letters
Here's my code
any help 'd be highly appreciatedCode:Public Function changesearch(Mytxt) As String Dim tempstr As String tempstr = Trim(Mytxt) If tempstr Like "*[أاآإ]*" Then For b = 1 To Len(tempstr) If Mid(tempstr, b, 1) = "ا" Or Mid(tempstr, b, 1) = "إ" Or Mid(tempstr, b, 1) = "أ" Or Mid(tempstr, b, 1) = "آ" Then Mid(tempstr, b, 1) = "ا" Else End If Next End If changesearch = tempstr End Function
Oh
Finally I got it
Change the Mid(tempstr,b,1) to Mid(tempstr,1,1)
It works as I hoped
anyway thanks
Hi Aysam,
Welcome to the forum, and thanks for posting that you found a solution. Hopefully next time we can be a bit more help to you.![]()
Ken Puls, FCPA, FCMA, MS MVP
Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!
Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter
If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.
Bookmarks