VBA Code pour RAZ listes en cascade sur plusieurs lignes

Rico2a

XLDnaute Nouveau
Bonjour,

J'ai essayé le code suivant pour remettre à 0 ma liste en cascade colonne Q quand je change de choix sur ma liste colonne P et ça marche !
Le problème est que je peux avoir plus de 1000 lignes...
J'ai essayé de faire avec une boucle, mais ça ne marche pas vu mes connaissances limitées en VBA.

Quelqu'un pourrait-il m'aider ?

Merci


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [P3]) Is Nothing Then [Q3] = ""
If Not Intersect(Target, [P4]) Is Nothing Then [Q4] = ""
If Not Intersect(Target, [P5]) Is Nothing Then [Q5] = ""
If Not Intersect(Target, [P6]) Is Nothing Then [Q6] = ""
If Not Intersect(Target, [P7]) Is Nothing Then [Q7] = ""
If Not Intersect(Target, [P8]) Is Nothing Then [Q8] = ""
If Not Intersect(Target, [P9]) Is Nothing Then [Q9] = ""
If Not Intersect(Target, [P10]) Is Nothing Then [Q10] = ""
If Not Intersect(Target, [P11]) Is Nothing Then [Q11] = ""
If Not Intersect(Target, [P12]) Is Nothing Then [Q13] = ""
If Not Intersect(Target, [P14]) Is Nothing Then [Q14] = ""
If Not Intersect(Target, [P15]) Is Nothing Then [Q15] = ""
If Not Intersect(Target, [P16]) Is Nothing Then [Q16] = ""
If Not Intersect(Target, [P17]) Is Nothing Then [Q17] = ""
If Not Intersect(Target, [P18]) Is Nothing Then [Q18] = ""
If Not Intersect(Target, [P19]) Is Nothing Then [Q19] = ""
If Not Intersect(Target, [P20]) Is Nothing Then [Q20] = ""

End Sub
 

Discussions similaires