Plantage liste semie automatique

meldja

XLDnaute Impliqué
Bonjour,
Après recherche sur le Net, je n'ai rien trouvé sur le sujet.
Voila, j'ai des listes semi-automatique qui fonctionnent très bien, mais qui ne marchent plus après protection de la feuille. Ces listes ont pourtant la protection désactiver dans le format de cellule.

Voici la formule de la liste de validation qui fonctionne sur feuille non protégée
Code:
=SI(B5<>"";DECALER(Formateur;EQUIV(B5&"*";Formateur;0)-1;;SOMMEPROD((STXT(Formateur;1;NBCAR(B5))=TEXTE(B5;"0"))*1));Formateur)
Je précise que la plage "Formateur" se trouve sur une autre feuille non protégée.

En fait, elles fonctionnent après protection de la feuille, mais sans le semi-automatique.
Si quelqu'un a déjà rencontré ce problème et a une solution, merci d'avance.
Je continue à chercher de mon côté.
 

meldja

XLDnaute Impliqué
Re : Plantage liste semie automatique

Pour l'instant, j'ai trouvé une solution par VBA, mais c'est pas terrible et ça m'oblige à traiter plein de plages de cellules. Voici ce que je dois mettre pour chaque plage (et j'en ai 10) :

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B5:M14")) Is Nothing Then
Sheets("Planning").Unprotect
End If
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B5:M14")) Is Nothing Then
Sheets("Planning").Protect
End If
End Sub

Il doit bien y avoir une autre solution ?
 

meldja

XLDnaute Impliqué
Re : Plantage liste semie automatique

Voici la dernière solution que j'ai trouvée (mais il doit bien y avoir autre chose de plus simple, sans code VBA) :

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B5:M14")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B19:M28")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B33:M42")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B47:M56")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B61:M70")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B75:M84")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B89:M98")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B103:M112")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B117:M126")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B131:M140")) Is Nothing Then
Sheets("Planning").Unprotect
End If
If Not Application.Intersect(Target, Range("B145:M154")) Is Nothing Then
Sheets("Planning").Unprotect
End If

If Not Application.Intersect(Target, Range("A1:A204")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B1:M4")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B15:M18")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B29:M32")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B43:M46")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B57:M60")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B71:M74")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B85:M88")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B99:M102")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B113:M116")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B127:M130")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B141:M144")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("B155:Z500")) Is Nothing Then
Sheets("Planning").Protect
End If
If Not Application.Intersect(Target, Range("Q1:Z500")) Is Nothing Then
Sheets("Planning").Protect
End If

End Sub

Encore merci, si quelqu'un a autre chose
 

Discussions similaires

Réponses
8
Affichages
167
Réponses
1
Affichages
114
Compte Supprimé 979
C

Statistiques des forums

Discussions
312 211
Messages
2 086 299
Membres
103 172
dernier inscrit
Aurelyan