+ Reply to Thread
Results 1 to 5 of 5

Translate words using other sheet.

  1. #1
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Smile Translate words using other sheet.

    Good day. Looking for a help, I want to translate all the words on sheet1 base on the sheet2 that I create.

    on "Sheet 1" there's sample words. that I want to be translated. I have a button on "sheet 1" when you click the button it will translate all the words on "Sheet 1" Base on the words I input on "Sheet 2" "Column B"

    on "Sheet 2" "Column A" the reference words.
    on "Sheet 2" "Column B" words that I wanted to be translat on "sheet 1"

    Thanks for the help in advance. GOD Bless.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    As any beginner can use Excel basics like the Search / Replace feature …

    Anyway according to your attachment another method as a VBA starter :

    PHP Code: 
    Sub Translator()
        
    With Sheet2.UsedRange.Columns
            W 
    = .Item(1).Value2
            X 
    = .Item(2).Value2
        End With
        With Sheet1
    .UsedRange.Columns(2)
                 
    = .Value2
            
    For R& = 2 To UBound(V)
                     
    Split(V(R1))
                For 
    C& = 0 To UBound(S)
                     
    Application.Match(S(C), W0)
                    If 
    IsNumeric(ZThen S(C) = X(Z1)
                
    Next
                    V
    (R1) = Join(S)
            
    Next
                
    .Value2 V
        End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Translate words using other sheet.

    jasond1992,

    It is only "Replacing", not "Translating" means the results are terrible...

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Obviously obvious : replacing can't be translating …


    Translating can be easily done under VBA piloting IE but slow … I don't know if exists some API.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb V2 ‼


    According to the attachment the VBA translation API version :

    PHP Code: 
    Private Sub Translator()
       Const 
    URL "https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=ja&dt=t&q="
         
    Dim L&, VR&, WXoReq As Object
             L 
    Sheet2.UsedRange.Rows.Count
        With Sheet1
    .UsedRange.Columns(2)
                
    = .Value2
            
    For 2 To UBound(V)
                    
    V(R1)
              If 
    Asc(W) <> 63 Then
                    X 
    Application.Match(WSheet2.UsedRange.Columns(1), 0)
                If 
    IsNumeric(XThen
                    V
    (R1) = Sheet2.UsedRange.Cells(X2).Text
                
    Else
                    If 
    oReq Is Nothing Then
                      
    .Font.ColorIndex 15
                       Set oReq 
    CreateObject("WinHttp.WinHttpRequest.5.1")
                    
    End If
                       
    Application.StatusBar "       Web  translating  cell  B" R
                       oReq
    .Open "GET"URL V(R1), False
                       oReq
    .setRequestHeader "DNT""1"
                       
    On Error Resume Next
                       oReq
    .send
                    
    If oReq.Status 200 Then
                       V
    (R1) = Split(oReq.responseText"""")(1)
                       If 
    V(R1) > "" And V(R1) <> W Then L 1Sheet2.[A:B].Rows(L).Value2 = Array(WV(R1))
                    
    End If
                       
    On Error GoTo 0
                End 
    If
              
    End If
            
    Next
               
    .Value2 V
            
    If Not oReq Is Nothing Then
               
    .Font.ColorIndex xlAutomatic
                Application
    .StatusBar False
                Sheet2
    .UsedRange.Columns.AutoFit
                Set oReq 
    Nothing
            End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to Google Translate Chinese words to English
    By oreosamosa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2021, 02:47 PM
  2. Macro: translate text from cell using google translate
    By Marc_excel_tips in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-05-2021, 06:18 AM
  3. Vba to translate english numbers to arabic words.
    By pitbullastog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2018, 11:53 AM
  4. [SOLVED] Translate Number to Words
    By ajimieta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2017, 04:31 AM
  5. Replies: 3
    Last Post: 04-29-2016, 04:10 AM
  6. Sample Translate English to Arabic Text Using MS Translate
    By pidyok in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2013, 08:18 AM
  7. Translate figures into words
    By Michael in forum Excel General
    Replies: 2
    Last Post: 01-16-2006, 04:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1