Re vous
Voici les 2 procedures:
et le fichier d'essai
Dim Ok As Boolean
Private Sub Worksheet_Calculate()
Dim Plage As String
Dim i As Integer
If Ok = True Then Exit Sub
Ok = True
i = 27
If Range("E33") = 1 Then
Do While Range("J" & i) <> ""
Plage = Range("J" & i).Value
Range(Plage).ClearContents
i = i + 1
Loop
End If
Ok = False
End Sub Private Sub Worksheet_Calculate () Dim Cel As Range
If Ok = True Then Exit Sub
Ok = True
Range(Range("G30")).ClearContents
If Range("B30") <> 0 Then
For Each Cel In Range(Range("G30"))
If Application.CountA(Range(Range("G30"))) = Range("B30") Then
Ok = False
Exit Sub
End If
Cel = Int((Range("F30") * Rnd) + 1)
Next Cel
End If
Ok = False
End Sub
Merci encore
Bisous
Muriel