"End If sans bloc If"

Résolu/Fermé
Ozzzz Messages postés 2 Date d'inscription vendredi 22 janvier 2016 Statut Membre Dernière intervention 22 janvier 2016 - 22 janv. 2016 à 12:05
Ozzzz Messages postés 2 Date d'inscription vendredi 22 janvier 2016 Statut Membre Dernière intervention 22 janvier 2016 - 22 janv. 2016 à 14:51
Bonjour,

Alors voilà mon problème, je dois coder une feuille excel pour que selon le choix fait dans 3 menu déroulant, la feuille ne nous propose qu'un cas bien précis.
Le seul problème est qu'à chaque fois que je le test, un message d'erreur apparait :

"Erreur de compilation
End If sans bloc If"

Après des recherches sur plusieurs forums, je suis toujours bloqué au même stade. C'est pourquoi je m'en remet à vous, merci d'avance !

Voici mon code :


If Target.Address = "$D$3" Then
Select Case Target.Value
Case Is = "10 <= N <= 30"
If Target.Address = "$G$3" Then
Select Case Target.Value
Case Is = "< 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
Casun
Select Case Target.Value
Case Is = "Collectif"
casci
End Select
End If

Select Case Target.Value
Case Is = ">= 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
casde
Select Case Target.Value
Case Is = "Collectif"
cassi
End Select
End If
End Select
End If

Select Case Target.Value
Case Is = "30 < N"
If Target.Address = "$G$3" Then
Select Case Target.Value
Case Is = "< 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
castr
Select Case Target.Value
Case Is = "Collectif"
casse
End Select
End If

Select Case Target.Value
Case Is = ">= 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
casqu
Select Case Target.Value
Case Is = "Collectif"
cashu
End Select
End If
End Select
End If
End Select
End If




1 réponse

Bonjour,
Et voilà

If Target.Address = "$D$3" Then
Select Case Target.Value

Case Is = "10 <= N <= 30"
If Target.Address = "$G$3" Then
Select Case Target.Value

Case Is = "< 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
Casun
Case Is = "Collectif"
casci
End Select
End If

Case Is = ">= 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
casde
Case Is = "Collectif"
cassi
End Select
End If
End Select
End If

Case Is = "30 < N"
If Target.Address = "$G$3" Then
Select Case Target.Value
Case Is = "< 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
castr
Case Is = "Collectif"
casse
End Select
End If

Case Is = ">= 35dB"
If Target.Address = "$K$3" Then
Select Case Target.Value
Case Is = "Individuel"
casqu
Case Is = "Collectif"
cashu
End Select
End If
End Select
End If
End Select
End If

Cordialement
1
Ozzzz Messages postés 2 Date d'inscription vendredi 22 janvier 2016 Statut Membre Dernière intervention 22 janvier 2016
22 janv. 2016 à 14:51
Merci beaucoup pour la rapidité et l'efficacité !

Cordialement
0