0 votes
in VBA by Expert (892 points)
Hello everyone

Sometimes when typing on keyboard in Arabic language, the language input is in English and I didn't notice that ..
Example:
hgpl] ggi vf hguhgldk

The example is Arabic words but when typing in English. Is there a function that converts the typed characters to the desired language?

 

The thread has been posted here

http://eileenslounge.com/viewtopic.php?f=30&t=33694
by Skilled (670 points)

Have you considered this Microsoft article? Translate text into a different language

by Expert (892 points)
Thanks a lot for reply, In fact this is not a translation. This is an issue of equivalent letters on keyboard in Arabic and English. Example: the letter t in English is "ف" in Arabic on keyboard.

1 Answer

0 votes
by Beginner (11 points)

הפונקצייה הבאה מתאימה למקלדת עברית,

כדי להתאים למקלדת בערבית את צריך לשנות את MyNewNote בהתאם למקלדת שלך,

(לדוגמא: במקום         Case "A", "a"
            MyNewNote = "ש"

תשנה ל:

        Case "A", "a"
            MyNewNote = "ف")

Option Compare Database

Public Function MyReplace(MyText) As String
    If IsNull(MyText) Or MyText = "" Then
        MyReplace = ""
    Exit Function
    End If
    For i = 1 To Len(MyText)
        NoteToRepkace = Mid$(MyText, i, 1)
        NewNote = MyNewNote(NoteToRepkace)
        NewText = NewText & NewNote
    Next i
    MyReplace = NewText
End Function

Function MyNewNote(OldNote) As String
    If IsNull(OldNote) Or OldNote = "" Then
        MyNewNote = ""
    Exit Function
    End If
    Select Case Left(OldNote, 1)
        Case "A", "a"
            MyNewNote = "ש"
        Case "B", "b"
            MyNewNote = "נ"
        Case "C", "c"
            MyNewNote = "ב"
        Case "D", "d"
            MyNewNote = "ג"
        Case "E", "e"
            MyNewNote = "ק"
        Case "F", "f"
            MyNewNote = "כ"
        Case "G", "g"
            MyNewNote = "ע"
        Case "H", "h"
            MyNewNote = "י"
        Case "I", "i"
            MyNewNote = "ן"
        Case "J", "j"
            MyNewNote = "ח"
        Case "K", "k"
            MyNewNote = "ל"
        Case "L", "l"
            MyNewNote = "ך"
        Case "M", "m"
            MyNewNote = "צ"
        Case "N", "n"
            MyNewNote = "מ"
        Case "O", "o"
            MyNewNote = "ם"
        Case "P", "p"
            MyNewNote = "פ"
        Case "Q", "q"
            MyNewNote = "/"
        Case "R", "r"
            MyNewNote = "ר"
        Case "S", "s"
            MyNewNote = "ד"
        Case "T", "t"
            MyNewNote = "א"
        Case "U", "u"
            MyNewNote = "ו"
        Case "V", "v"
            MyNewNote = "ה"
        Case "W", "w"
            MyNewNote = "'"
        Case "X", "x"
            MyNewNote = "ס"
        Case "Y", "y"
            MyNewNote = "ט"
        Case "Z", "z"
            MyNewNote = "ז"
        Case "`"
            MyNewNote = ";"
        Case ";"
            MyNewNote = "ף"
        Case "'"
            MyNewNote = ","
        Case "/"
            MyNewNote = "."
        Case "."
            MyNewNote = "ץ"
        Case ","
            MyNewNote = "ת"
        Case "("
            MyNewNote = ")"
        Case ")"
            MyNewNote = "("
        Case "["
            MyNewNote = "]"
        Case "]"
            MyNewNote = "["
        Case "{"
            MyNewNote = "}"
        Case "}"
            MyNewNote = "{"
        Case "<"
            MyNewNote = ">"
        Case ">"
            MyNewNote = "<"
        Case Else
            MyNewNote = OldNote
    End Select
End Function

 

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

Looking for something else? Hire our professional VBA Help, instead.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and answers. All you have to do is post and you could get rewarded, like these members:

ParserMonster $25 Amazon Gift Card
Hightree $10 Amazon Gift Card
Thales1 $10 Amazon Gift Card
runfunke $10 Amazon Gift Card
coolag $10 Amazon Gift Card
Siew Hun $10 Amazon Gift Card

So, why don't you join us? It really is an encouraging way to motivate members in our VBA and Python community.

Register

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...