Tu devrais remplacer le code de la feuille module par ceci :
Dim X As Long '------------------------------ Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim C As String Application.EnableEvents = False If Target.Address = Range("E11").Address Then With Application X = .RandBetween(1, 141) Range("C11") = "" Range("E11") = "" Range("D11") = .Index(Feuil1.Range("Français"), X, 0) End With Else If X = 0 Then Application.EnableEvents = True: Exit Sub With Application C = .Index(Feuil1.Range("Anglais"), X, 0) Range("C11") = C End With End If Application.EnableEvents = True End Sub '------------------------------
Tu devrais remplacer le code de la feuille module par ceci :
Dim X As Long
'------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim C As String
Application.EnableEvents = False
If Target.Address = Range("E11").Address Then
With Application
X = .RandBetween(1, 141)
Range("C11") = ""
Range("E11") = ""
Range("D11") = .Index(Feuil1.Range("Français"), X, 0)
End With
Else
If X = 0 Then Application.EnableEvents = True: Exit Sub
With Application
C = .Index(Feuil1.Range("Anglais"), X, 0)
Range("C11") = C
End With
End If
Application.EnableEvents = True
End Sub
'------------------------------
Tu devrais remplacer le code de la feuille module par ceci :
Dim X As Long '------------------------------ Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim C As String Application.EnableEvents = False If Target.Address = Range("E11").Address Then With Application X = .RandBetween(1, 141) Range("C11") = "" Range("E11") = "" Range("D11") = .Index(Feuil1.Range("Français"), X, 0) End With Else If X = 0 Then Application.EnableEvents = True: Exit Sub With Application C = .Index(Feuil1.Range("Anglais"), X, 0) Range("C11") = C End With End If Application.EnableEvents = True End Sub '------------------------------