我想翻译输入表中的每个标题,并在其中应自动将源语言检测为英语(默认),如果有人可以在此方面帮助/支持我,那将非常好。预先感谢!
答案 0 :(得分: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
答案 1 :(得分:0)
请根据您的要求进行for循环(在此,我正在按列进行操作)
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