Plusieurs listes déroulantes que je souhaite protéger

Bonjour,

Je souhaite empêcher la suppression de mes listes déroulantes sur une feuille protégée.

J'ai trouvé ce programme mais il fonctionne uniquement pour une seule liste déroulante :

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address <> "$H$19" Then Exit Sub

If Target = "" Then Application.Undo

End Sub

J'ai besoin de protéger plusieurs listes déroulantes sur une même feuille.

j'ai essayé sans succès de modifier ce programme :

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address <> "$H$19" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$E$31" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$E$35" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$L$8" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$O$15" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$P$15" Then Exit Sub

If Target = "" Then Application.Undo

If Target.Address <> "$P$20" Then Exit Sub

If Target = "" Then Application.Undo

End Sub

Pourriez-vous m'aider svp ?

Jonathan

Bonjour Jonathan60,

Voici

Private Sub Worksheet_Change(ByVal Target As Range)
  ' Si la modification se fait dans la cellule
  If Not Intersect(Range("$H$19,$E$31,$E$35,$L$8,$O$15,$P$15,$P$20"), Target) Then
    ' Désactiver les évènements
    Application.EnableEvents = False
    If Target = "" Then Application.Undo
    ' Réaactiver les évènements
    Application.EnableEvents = True
  End If
End Sub

@+

Bonjour

Comme ça peut etre ?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$H$19" And Target.Address <> "$E$31" And Target.Address <> "$E$35" And Target.Address <> "$L$8" And Target.Address <> "$O$15" And Target.Address <> "$P$15" And Target.Address <> "$P$20" Then Exit Sub
If Target = "" Then Application.Undo
End Sub

A plus sur le forum

Merci beaucoup, c'est tout à fait ca !!!

Rechercher des sujets similaires à "listes deroulantes que souhaite proteger"