1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Option Explicit
Dim ind As Long
Private Sub CommandButton4_Click()'c'est le bouton pour changer la langue
ind = ind + 1
If ind = 6 Then ind = 3
change_langue ind
End Sub
Private Sub UserForm_Activate()
Dim langue As Single, colonne As Long, plage As Range, cel As Range
ind = 3
langue = (Application.LanguageSettings.LanguageID(msoLanguageIDUI))
Select Case langue
Case 1036, 2060, 11276, 3084, 9228, 12300, 15372, 5132, 13324, 6156, 14348, 58380, 8204, 10252, 4108, 7180: colonne = 3 'francais
Case 1033, 2057, 3081, 10249, 4105, 9225, 15369, 16393, 14345, 6153, 8201, 17417, 5129, 13321, 18441, 7177, 11273, 12297: colonne = 4 'anglais
Case 1031, 3079, 5127, 4103, 2055: colonne = 5 'allemand
End Select
Set plage = Range("B2:B5").Cells
For Each cel In plage
Debug.Print cel
Me.Controls(cel.Text).Caption = Cells(cel.Row, colonne).Text
Next
End Sub
Private Sub change_langue(indexlangue)
Dim plage As Range, cel As Range
Set plage = Range("B2:B5").Cells
For Each cel In plage
Debug.Print cel
Me.Controls(cel.Text).Caption = Cells(cel.Row, indexlangue).Text
Next
End Sub |