Good Day All It is work well ,But not support Arabic to En
</xml><![endif]--></head>****** ><div class=WordSection1><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=1111 style='width:833.0pt;margin-left:-.15pt;border-collapse:collapse'><tr style='height:15.0pt'><td width=23 nowrap valign=bottom style='width:17.0pt;border:solid windowtext 1.0pt;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'> <o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>A<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>B<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>C<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>D<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>E<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>F<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>G<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>H<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>I<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>J<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>K<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>L<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>M<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>N<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>O<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>P<o
></o
></span></p></td><td width=64 nowrap style='width:48.0pt;border:solid windowtext 1.0pt;border-left:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>Q<o
></o
></span></p></td></tr><tr style='height:15.0pt'><td width=23 nowrap style='width:17.0pt;border:solid windowtext 1.0pt;border-top:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>1<o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=right dir=RTL style='text-align:left'><span lang=AR-SA style='color:black'>ÞãÑ</span><span dir=LTR style='color:black'><o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:red'>???<span lang=AR-SA dir=RTL><o
></o
></span></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span lang=AR-SA dir=RTL style='color:black'> </span><span style='color:black'><o
></o
></span></p></td><td width=256 nowrap colspan=4 valign=bottom style='width:192.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>[[</span><span style='color:red'>["???","???"</span><span style='color:black'>,null,null,3]],null,"ar"]<o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'> <o
></o
></span></p></td><td width=576 nowrap colspan=9 valign=bottom style='width:6.0in;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'>https://translate.googleapis.com/translate_a/single?client=gtx&sl=ar&tl=en&dt=t&q=<span lang=AR-SA dir=RTL>ÞãÑ</span><o
></o
></span></p></td></tr><tr style='height:15.0pt'><td width=23 nowrap style='width:17.0pt;border:solid windowtext 1.0pt;border-top:none;background:#BDD7EE;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>2<o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'>Moon<o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=right dir=RTL style='text-align:left'><span lang=AR-SA style='color:black'>ÇáÞãÑ</span><span dir=LTR style='color:black'><o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'> <span lang=AR-SA dir=RTL><o
></o
></span></span></p></td><td width=256 nowrap colspan=4 valign=bottom style='width:192.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span dir=LTR></span><span dir=LTR></span><span style='color:black'><span dir=LTR></span><span dir=LTR></span>[[["<span lang=AR-SA dir=RTL>ÇáÞãÑ</span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span>","Moon",null,null,1]],null,"en"]<o
></o
></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><span style='color:black'> <o
></o
></span></p></td><td width=576 nowrap colspan=9 valign=bottom style='width:6.0in;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'><p class=MsoNormal align=center style='text-align:center;direction:ltr;unicode-bidi:embed'><span style='color:black'>https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=ar&dt=t&q=Moon<o
></o
></span></p></td></tr></table><p class=MsoNormal style='text-align:left;direction:ltr;unicode-bidi:embed'><o
> </o
></p></div></body></html>
Code:
Private Const strSHORTCODES As String = ",en,af,sq,ar,hy,az,eu,be,bn,bg,ca,zh,hr,cs,da,nl,eo,et,tl,fi,fr,gl,ka,de,el,gu,ht,iw,hi,hu,is,id,ga,it,ja,kn,ko,lo,la,lv,lt,mk,ms,mt,no,fa,pl,pt-PT,ro,ru,sr,sk,sl,es,sw,sv,ta,te,th,tr,uk,ur,vi,cy,yi"
Public Enum eLanguage
Auto_Detect
English
Afrikaans
Albanian
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bengali
Bulgarian
Catalan
Chinese
Croatian
Czech
Danish
Dutch
Esperanto
Estonian
Filipino
Finnish
French
Galician
Georgian
German
Greek
Gujarati
Haitian_Creole
Hebrew
Hindi
Hungarian
Icelandic
Indonesian
Irish
Italian
Japanese
Kannada
Korean
Lao
Latin
Latvian
Lithuanian
Macedonian
Malay
Maltese
Norwegian
Persian
Polish
Portuguese
Romanian
Russian
Serbian
Slovak
Slovenian
Spanish
Swahili
Swedish
Tamil
Telugu
Thai
Turkish
Ukrainian
Urdu
Vietnamese
Welsh
Yiddish
End Enum
Public Function Translate(ByVal strText As String, _
Optional ByVal eFrom As String, _
Optional ByVal eTo As String) As String
Dim strUrl As String
Dim strResult As String
strText = Replace$(strText, Chr$(32), "%20")
strText = Replace$(strText, Chr$(160), "%20")
'strUrl = "http://translate.google.com/translate_a/t?client=t&text={S}&hl=en&sl={F}&tl={T}&multires=1&pc=0&rom=1&sc=1"' not work
'strUrl = "https://translate.google.com/#{F}/{T}/{S}"
strUrl = "https://translate.googleapis.com/translate_a/single?client=gtx&sl={F}&tl={T}&dt=t&q={S}"
strUrl = Replace$(strUrl, "{S}", strText)
strUrl = Replace$(strUrl, "{F}", Split(strSHORTCODES, ",")(eFrom))
strUrl = Replace$(strUrl, "{T}", Split(strSHORTCODES, ",")(eTo))
With CreateObject("MSXML2.XMLHTTP")
Call .Open("get", strUrl, False)
Call .Send
strResult = .responseText
End With
'''''''''''''''''''Temprary''''''''''''''''''''''
If eFrom = Arabic Then '
[I1] = strUrl ' remove it as you need( for test)'
[D1] = strResult '
Else '
[I2] = strUrl ' remove it as you need( for test)'
[D2] = strResult '
End If '
'''''''''''''''''''''''''''''''''''''''''''''''''
varSplitText = Split(Split(strResult, "]],")(0), "[")
If Not blnPhonetic Then
For lngItem = 3 To UBound(varSplitText)
strTransText = strTransText & Split(varSplitText(lngItem), ",")(0)
Next
Else
For lngItem = 3 To UBound(varSplitText)
strTransText = strTransText & Split(varSplitText(lngItem), "delimitChar")(2)
Next
End If
strResult = Replace(strTransText, """", "")
Translate = strResult
End Function
Public Sub TranslateSheet()
Dim wksForeign As Excel.Worksheet
Dim wksResults As Excel.Worksheet
Dim rngCell As Excel.Range
Set wksForeign = Worksheets(1)
'''''''''''''''''''''Temprary you can remove'''''''''''''''''''''''
With wksForeign
.Cells.Clear
.Range("A1") = ChrW(1602) & ChrW(1605) & ChrW(1585) '
.Range("A2") = "Moon" '
.Range("A1").Offset(0, 1).Value2 = Translate(.Range("A1").Value2, Arabic, English)
.Range("A2").Offset(0, 1).Value2 = Translate(.Range("A2").Value2, English, Arabic)
End With
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0
For Each rngCell In wksForeign.Range("A1:A2")
'rngCell.Offset(0, 1).Value2 = Translate(rngCell.Value2, Arabic, English)
Next rngCell
End Sub