0

I want to translate each headers from the Input sheet, where it supposed to auto detect the from language To English (default), It would be so great, if anyone can help /support me on this. Thanks in advance!

JvdV
  • 70,606
  • 8
  • 39
  • 70
  • Maybe no auto-detect, but here is usefull information to make an UDF that translates for you [link](https://analystcave.com/excel-google-translate-functionality/), and [here](https://stackoverflow.com/questions/19098260/translate-text-using-vba) another interesting example. I know GS got a special function to detect a language. – JvdV Jun 27 '19 at 11:47
  • @JvdV Please refer this one https://stackoverflow.com/q/56966594/11690868 – Black Bala Jul 10 '19 at 08:40

2 Answers2

0
Option Explicit
Dim Rst_Wrd As String

Const langCode = ("auto,en,fr,es")
Public Enum LanguageCode
    InputAuto = 0
    InputEnglish = 1
    InputFrench = 2
    InputSpanish = 3
End Enum

Public Enum LanguageCode2
    ReturnEnglish = 1
    ReturnFrench = 2
    ReturnSpanish = 3
End Enum
0

Please do for loop as per your requirement (here i'm doing with column wise)

Sub GoogleTranslate()
    Dim i, Col As Integer
    Col = ActiveSheet.UsedRange.Columns.Count
    For i = 1 To Col
        If Cells(1, i).Value <> "" Then
            Call AutoTranslate(Cells(1, i), InputAuto, ReturnEnglish)
            Cells(1, i).Value = Rst_Wrd
        End If
    Next i

    MsgBox "Translate completed successfully..."

End Sub