Sub AnglaisFrancais()
'TIRAGE(ALÉATOIRE SANS RÉPÉTITION)
Dim F1, F2 As Worksheet
Set F1 = ThisWorkbook.Worksheets("Feuil1")
Set F2 = ThisWorkbook.Worksheets("Feuil2")
' Tableau feuille 2 (Colonne A et B) = Liste
dim TabAngFran as Variant
Fin = F2.Range("A65536").End(xlUp).Row
TabAngFran = F2.Range(F2.Cells(1, 1), F2.Cells(Fin, 2))
Dim i As Integer
Dim NumAleat As Integer
' Redimension du tableau ajout d'une colone pour test
ReDim Preserve TabAngFran(1 To Fin - 1, 1 To 3)
' Rempli la colonne 3 toute a 1
For i = 1 To UBound(TabAngFran, 1)
TabAngFran(i, 3) = 1
Next i
For i = 1 To UBound(TabAngFran, 1)
NumAleat = Int(Rnd() * UBound(TabAngFran, 1)) + 1
If TabAngFran(NumAleat, 3) = 1 Then
TabAngFran(NumAleat, 3) = 0
F1.Cells(1, 1).Value = TabAngFran(NumAleat, 1)
F1.Cells(1, 2).Value = TabAngFran(NumAleat, 2)
MsgBox "Autres Mots"
F1.Cells(1, 1).Value = Clear
F1.Cells(1, 2).Value = Clear
Else
While TabAngFran(NumAleat, 3) = 0
NumAleat = Int(Rnd() * UBound(TabAngFran, 1)) + 1
Wend
TabAngFran(NumAleat, 3) = 0
End If
Next i
End Sub