Private Sub Worksheet_Change(ByVal Target As Range)
Dim MonBouton As OLEObject, Bouton1, Bouton2
If Not Intersect(Target, Range("F5")) Is Nothing Then
If IsEmpty(Target.Value) Then
For Each MonBouton In ActiveSheet.OLEObjects
If TypeOf MonBouton.Object Is MSForms.CommandButton Then
MonBouton.Visible = False
End If
Next
Else
If Target.Value > 10 Then
MsgBox "Erreur N° trop grand"
Exit Sub
End If
For Each MonBouton In ActiveSheet.OLEObjects
If TypeOf MonBouton.Object Is MSForms.CommandButton Then
Bouton1 = "CommandButton" & Target.Value * 2
Bouton2 = "CommandButton" & Target.Value * 2 - 1
If MonBouton.Name = Bouton1 Or MonBouton.Name = Bouton2 Then
MonBouton.Visible = True
End If
End If
Next
End If
End If
End Sub