Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Sub test() For Each cel In Range([T6], [T10000].End(xlUp)) Dim s As String s = cel MsgBox translate_using_vba(s) Next cel End Sub Function translate_using_vba(str) As String ' Tools Refrence Select Microsoft internet Control Dim IE As Object, i As Long Dim inputstring As String, outputstring As String, text_to_convert As String, result_data As String, CLEAN_DATA Set IE = CreateObject("InternetExplorer.application") ' TO CHOOSE INPUT LANGUAGE inputstring = "es" ' TO CHOOSE OUTPUT LANGUAGE outputstring = "en" text_to_convert = str 'open website IE.Visible = False IE.navigate "http://translate.google.com/?hl=en&tab=wT/#" & inputstring & "/" & outputstring & "/" & text_to_convert Do Until IE.ReadyState = 4 DoEvents Loop Application.Wait (Now + TimeValue("0:00:2")) Do Until IE.ReadyState = 4 DoEvents Loop CLEAN_DATA = Split(Application.WorksheetFunction.Substitute(IE.Document.getElementById("result_box").innerHTML, "</SPAN>", ""), "<") For j = LBound(CLEAN_DATA) To UBound(CLEAN_DATA) result_data = result_data & Right(CLEAN_DATA(j), Len(CLEAN_DATA(j)) - InStr(CLEAN_DATA(j), ">")) Next IE.Quit translate_using_vba = result_data End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.