Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

how to change WRITTIN vba code in excel to English

0

Good day!

Could you please help me on this matter, I have an excel file with many VBA codes and those codes are in Portuguese. how can I change this code to English?

your kind support would be highly appreciated.

Private Sub ToggleButton1_Click()

Dim aba As String

MostraAba ("FO35")

End Sub

Private Sub CommandButton2_Click()

'

' Apaga linha na Table5

'

Dim UltimaLinha As Long

Dim CelVinculada As Variant

Dim linha As Long

Dim rsp As Single

ActiveSheet.Unprotect

Application.ScreenUpdating = False

CelVinculada = Cells(3, 15).Value

'Ultima Linha salva na Tabela5

UltimaLinha = ActiveSheet.Cells(Rows.Count, 57).End(xlUp).Row

'Verifica se a data faz parte da tabela

For linha = 4 To UltimaLinha

    If Cells(linha, 57).Value = CelVinculada Then

        rsp = MsgBox("Deseja apagar o registro selecionado ?", vbYesNo, "Apagar Registro")

        Select Case rsp

           Case 6

            Exit For

           Case 7

            Exit Sub

        End Select

    End If

    If linha = UltimaLinha Then

        rsp = MsgBox("Registro não encontrado", vbInformation)

        Exit Sub

    End If

Next linha

'

'Apaga a linha referente à CelVinculada

'

Range("Table5[DATE]").Select

Selection.ListObject.ListRows(linha - 3).Delete

'

'Seleciona outra linha para mostrar os dados

'

If UltimaLinha > 4 Then

    CelVinculada = Cells(UltimaLinha - 1, 57).Value

    Cells(3, 15).Value = CelVinculada

    MostraSondagem (CelVinculada)

    Range("F2").Select

Else

    Range("A1, B2, F2, K1, K2, E4:E16, E18:E21, E23:E42, G23, G4:H21") = ""

    Range("F2").Select

End If

Application.ScreenUpdating = True

ActiveSheet.Protect

End Sub

Private Sub CommandButton1_Click()

'

' Grava valores na tabela5

'

Dim SG(77), CelVinculada As Variant

Dim UltimaLinha, linha, escolha As Double

Dim i, coluna As Integer

ActiveSheet.Unprotect

Application.ScreenUpdating = False

'Dados do cabeçalho

SG(1) = Cells(2, 6)     'DATE

SG(2) = Cells(1, 1)     'TYPE

SG(3) = Cells(2, 2)     'PLACE

SG(4) = Cells(1, 11)    'D.FWD

SG(5) = Cells(2, 11)    'D.AFT

'Ultima Linha salva na Tabela5

lastrow = ActiveSheet.Cells(Rows.Count, 57).End(xlUp).Row

'Verifica se a data já foi salva na tabela

For Row = 4 To lastrow

    If Cells(Row, 57).Value <> SG(1) Then

    Row = Row + 1

    Insert = lastrow + 1

    Else

        rsp = MsgBox("Essa data já foi salva na tabela, sobrepor ?", vbYesNo, "Salvar na tabela")

        Select Case rsp

            Case 6  'Yes

                Insert = linha

                Exit For

            Case 7  'No

                Exit Sub

        End Select

    End If

Next

'

'Grava na Table5

'

coluna = 57

For i = 1 To 77

    Cells(escolha, coluna).Value = SG(i)

    coluna = coluna + 1

Next i

'

'Mostra os dados

'

UltimaLinha = ActiveSheet.Cells(Rows.Count, 57).End(xlUp).Row

CelVinculada = Cells(UltimaLinha, 57).Value

MostraSondagem (CelVinculada)

Range("F2").Select

Application.ScreenUpdating = True

ActiveSheet.Protect

End Sub

Answer
Discuss

Discussion

Please put CODE tags around your code. To do that, edit your post, select your code and click the CODE button.
don (rep: 1989) Jan 21, '22 at 4:37 pm
Add to Discussion

Answers

0

Hi there, please read my comment on your post - CODE tags make everyone's life better :)

For your code, the VBA is already in English. However, the things like variable names, text output, etc. is all in, I'm guessing, Portuguese. If you want to translate the output, just use something like Google translate. If you want to translate the variable names, you can also do that, but you might cause bugs in your code during this process because it is difficult to do without error. However, Find/Replace is your friend in this matter.

I'm not sure if there is a service that would translate this all at once, and I'm feeling like Google Translate would break the code if you just copy/pasted it all in there and then brought it all back to the VBE.

Discuss

Discussion

Hi Don,

When I read the post , my immediate thought was this should be a simple solve. Then I read on and saw your post and that is exactly what I thought. And curiousity being what it is, I tried a couple of the words and phrases in Google Translate. Yup, it works, and they are Portuguese. With a little patience Ammar can, as you suggest, use Google Translate one word at a time, then use Find and Replace and make it all English.
WillieD24 (rep: 557) Jan 21, '22 at 10:30 pm
Ammar. I agree with Don (the code should work even though the variables and comments are in Portuguese). Note that the code in the question does not works alone- there are other subs (or functions) like MostraAba and  MostraSondagem elsewhere in the workbook's VBA Project. (They are called in lines like 
MostraAba ("FO35")
If you want to changeMostraAba to ShowTab say, you'll need to rename that sub (or function) too.
John_Ru (rep: 6142) Jan 22, '22 at 3:56 am
Hi there,
Thank you John & Don a lot for your response. I've tried to use google translate but unfortunately, I'm getting errors ( already one week )
May you can help me on this matter. I want to create such codes, unfortunately, I could't. 
I'm new in VBA :)
Ammar Jan 24, '22 at 2:23 pm
I've included an excel file in my first post. Please take a look.
Ammar Jan 24, '22 at 2:29 pm
Ammar- I looked at your file and don't know what you want to do....

The code above relates to the four ToggleButtons (which I found near cells A10:A14 on protected sheet Sondagem Geral). Once that sheet is unprotected, clicking those buttons makes the appropriate sheet visisble (or hidden if clicked again). They work (even though the variable names and comments may be in Portuguese) so why are you trying to "translate" the code (a tricky task, as Don said)? Feels like there's nothing to fix here (apart from the language, which is not what the Forum is about!)

Also, do you have the permission of the file's authors (ECR/ Charlles Viol) to modify this file?
John_Ru (rep: 6142) Jan 25, '22 at 8:55 am
Hi John,
Thanks again for your swift reply.
I just want to create such codes in English for my future job. I'm working as a marine chief engineer and such an excel sheet is very useful for my job when I'm on board a ship. Yes, I can modify it (Charlles Viol one of our previous engineers and he is not working anymore for our company).  So I'm planning to create on each vessel where I'm working such file which make our life more easier. 
Ammar Jan 25, '22 at 7:35 pm
I love too much excel and every time i'm trying to create something new. 
Ammar Jan 25, '22 at 7:36 pm
Understood Ammar but I don't have the time (or interest!) to do the translation task for you. For comments in the code (lines starting with ') or message strings, you can use Google Translate. The rest needs careful use of Find and Replace in the VBA Project but it's better if you can recognise VBA language first (which you mustn't try to translate).

If you don't know much VBA, it's a great help, particularly in technical jobs like yours. Today is your last day to get  discount on Don's online VBA course. I haven't done that yet but it looks great and will be to the same high standard as his tutorials. I think it would be a great investment for your future and increase your love of Excel.
John_Ru (rep: 6142) Jan 26, '22 at 4:19 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login