"excelvba udf translate text" Code Answer's

You're definitely familiar with the best coding language VBA that developers use to develop their projects and they get all their queries like "excelvba udf translate text" answered properly. Developers are finding an appropriate answer about excelvba udf translate text related to the VBA coding language. By visiting this online portal developers get answers concerning VBA codes question like excelvba udf translate text. Enter your desired code related query in the search bar and get every piece of information about VBA code related question on excelvba udf translate text. 

excelvba udf translate text

By Excel HeroExcel Hero on Jan 01, 1970
'Here is a VBA User Defined Function to translate text in an Excel cell. It 
'uitlizes Google Translate and thus requires an Internet connection:

Function Translate$(sText$, FromLang$, ToLang$)
    Dim p1&, p2&, url$, resp$
    Const DIV_RESULT$ = "<div class=""result-container"">"
    Const URL_TEMPLATE$ = "https://translate.google.com/m?hl=[from]&sl=[from]&tl=[to]&ie=UTF-8&prev=_m&q="
    url = URL_TEMPLATE & WorksheetFunction.EncodeURL(sText)
    url = Replace(url, "[to]", ToLang)
    url = Replace(url, "[from]", FromLang)
    resp = WorksheetFunction.WebService(url)
    p1 = InStr(resp, DIV_RESULT)
    If p1 Then
        p1 = p1 + Len(DIV_RESULT)
        p2 = InStr(p1, resp, "</div>")
        Translate = Mid$(resp, p1, p2 - p1)
    End If
End Function

'------------------------------------------------------------------------------

'With the following text in cell A1: Every moment is a fresh beginning.

'In cell B1, enter this formula:

=Translate(A1, "en", "fr")    '<--translates text in A1 from English to French.

'The result in cell B1 will be: Chaque instant est un nouveau départ.


'Of course the Translate() function can be used directly from VBA as well:

MsgBox Translate([A1], "en", "de")  '<--displays: Jeder Moment ist ein Neuanfang.


'And of course you may also manually use the Translate functionality 
'built into Excel, which can be found on the Review tab of the 
'Ribbon. But the UDF above provides a quick and streamlined method 
'to translate text programmatically. Excel's translation capability 
'is not exposed via the Excel Object Model, so a function like the 
'above can be quite useful.


'The "FromLang" and "ToLang" arguments must be codes from the following table:

' CODE   LANGUAGE
' en	 English
' fr	 French
' es	 Spanish
' it     Italian
' de     German
' af	 Afrikaans
' sq	 Albanian
' am	 Amharic
' ar	 Arabic
' hy	 Armenian
' az	 Azerbaijani
' eu	 Basque
' be	 Belarusian
' bn	 Bengali
' bs	 Bosnian
' bg	 Bulgarian
' ca	 Catalan
' ceb    Cebuano
' ny	 Chichewa
' zh-CN  Chinese (Simplified)
' zh-TW  Chinese (Traditional)
' co	 Corsican
' hr	 Croatian
' cs	 Czech
' da	 Danish
' nl	 Dutch
' eo	 Esperanto
' et	 Estonian
' tl	 Filipino
' fi	 Finnish
' fy	 Frisian
' gl	 Galician
' ka	 Georgian
' el	 Greek
' gu	 Gujarati
' ht	 Haitian Creole
' ha	 Hausa
' haw    Hawaiian
' iw	 Hebrew
' hi	 Hindi
' hmn    Hmong
' hu	 Hungarian
' is	 Icelandic
' ig	 Igbo
' id	 Indonesian
' ga	 Irish
' ja	 Japanese
' jw	 Javanese
' kn	 Kannada
' kk	 Kazakh
' km	 Khmer
' rw	 Kinyarwanda
' ko	 Korean
' ku	 Kurdish (Kurmanji)
' ky	 Kyrgyz
' lo	 Lao
' la	 Latin
' lv	 Latvian
' lt	 Lithuanian
' lb	 Luxembourgish
' mk	 Macedonian
' mg	 Malagasy
' ms	 Malay
' ml	 Malayalam
' mt	 Maltese
' mi	 Maori
' mr	 Marathi
' mn	 Mongolian
' my	 Myanmar (Burmese)
' ne	 Nepali
' no	 Norwegian
' or	 Odia (Oriya)
' ps	 Pashto
' fa	 Persian
' pl	 Polish
' pt	 Portuguese
' pa	 Punjabi
' ro	 Romanian
' ru	 Russian
' sm	 Samoan
' gd	 Scots Gaelic
' sr	 Serbian
' st	 Sesotho
' sn	 Shona
' sd	 Sindhi
' si	 Sinhala
' sk	 Slovak
' sl	 Slovenian
' so	 Somali
' su	 Sundanese
' sw	 Swahili
' sv	 Swedish
' tg	 Tajik
' ta	 Tamil
' tt	 Tatar
' te	 Telugu
' th	 Thai
' tr	 Turkish
' tk	 Turkmen
' uk	 Ukrainian
' ur	 Urdu
' ug	 Uyghur
' uz	 Uzbek
' vi	 Vietnamese
' cy	 Welsh
' xh	 Xhosa
' yi	 Yiddish
' yo	 Yoruba
' zu	 Zulu
'
'
'

Source: academy.excelhero.com

Add Comment

20

All those coders who are working on the VBA based application and are stuck on excelvba udf translate text can get a collection of related answers to their query. Programmers need to enter their query on excelvba udf translate text related to VBA code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about excelvba udf translate text for the programmers working on VBA code while coding their module. Coders are also allowed to rectify already present answers of excelvba udf translate text while working on the VBA language code. Developers can add up suggestions if they deem fit any other answer relating to "excelvba udf translate text". Visit this developer's friendly online web community, CodeProZone, and get your queries like excelvba udf translate text resolved professionally and stay updated to the latest VBA updates. 

VBA answers related to "excelvba udf translate text"

View All VBA queries

VBA queries related to "excelvba udf translate text"

excelvba udf translate text xl vba udf translate text vba udf translate text excelvba translate to english from french Excel VBA Function Overloading and UDF excel udf get unique values excelvba parse hex digits text string filter excelvba keep only hex digits from text string excelvba check for directory excelvba quotes in string excelvba clear contents and formatting of cell excelvba declare global constant excelvba long integer to binary string excelvba 32-bit long integer to bits excelvba code execution has been halted excelvba large binary string to hex excelvba repeat given string n times excelvba check if specific bits are set in longlong excelvba test if target is exactly a named range excelvba running code from HYPERLINK() function in cell excelvba check if specific bits set in int32 excelvba Convert HEX string to Unsigned INT excelvba big hex string to decimal excelvba large hexadecimal string to decimal excelvba check if specific bits are set in int32 excelvba write to clipboard excelvba return a result from a function excelvba binary bits to short integer excelvba test if specific bits set in integer excelvba compare two rows excelvba test if target is precisely a named range excelvba test if specific bits set in byte excelvba is bit set in 64-bit integer excelvba is bit set in 64-bit longlong integer excelvba check if bit set in 64-bit longlong integer excelvba binary to decimal 8bits excelvba random function excelvba load csv file into an array rather than the worksheet xl user defined function translate text translate text in Excel excel vba translate text vba translate text excel vba translate to english from french excel vba HTML text with tags to formatted text in an cell excel vba write string to text file excel vba open text file how to check is the value enterd is a number or text in vba excel vba difference between .value .value2 .text .formula .formular1c1 excel vba range.text how to INPUT text in shape with enter and spacein vba excel vba convert text YYYYMMDD to date excel vba bold some text in cell excel vba color text in cell excel vba text to binary string excel vba read text from clipboard write to text file vb.net excel vba text compression vba text compression vba parse hex digits text string filter excel vba keep only hex digits from text string vba write text file vba column wrap text add text to Shape VBA vba add text to word document write listbox to text file vb.net send text to clipboard vb.net vba text between delimiters vba text between two characters vba text to general vba userform textbox wrap text vba text max line length how to wrap text in excel excel text to columns line break how to carry text to the next line in a label in vb.net excel vba open word document and find text add text to combobox drop down vb vba get text file content vba extract text between brackets vba text between search for text in every worksheet excel visual basic loop through all text boxes in a form vb Add Formula to Shape Text in VBA text to speech vb.net excel vba change number format of cell to text

Browse Other Code Languages

CodeProZone