bonjour,

je dois créer une procédure qui va, en fonction de 11 group box de 4 option button chacun, gérer le lancement de telle ou telle fonction définie dans un module ou si l'utilisateur a fait un choix pas approprié, un message d'erreur apparaitra.

avec tous ces boutons ( que je ne peux pas regrouper graphique imposé pour ce projet),12 if sont créés les uns dans les autres....peu pratique et peu lisible.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
If Sheets("NRW & CG").Range("I3").Value = 0 Then
    If OpB_NLG_ext.Value = True Then
        Sheets("Removed large component").ChBx_NLG.Value = False
        If OpB_LH_BLG_ext.Value = True Then
            Sheets("Removed large component").ChBx_LH_BLG.Value = False
            If OpB_LH_WLG_ext.Value = True Then
                Sheets("Removed large component").ChBx_LH_WLG.Value = False
                If OpB_RH_BLG_ext.Value = True Then
                    Sheets("Removed large component").ChBx_RH_BLG.Value = False
                    If OpB_RH_WLG_ext.Value = True Then
                        Sheets("Removed large component").ChBx_RH_WLG.Value = False
                        If OpB_LH_OE_att.Value = True Then
                            Sheets("Removed large component").ChBx_LH_out_engine1.Value = False
                            If OpB_LH_IE_att.Value = True Then
                                Sheets("Removed large component").ChBx_LH_in_engine2.Value = False
                                If OpB_RH_OE_att.Value = True Then
                                    Sheets("Removed large component").ChBx_RH_out_engine4.Value = False
                                    If OpB_RH_IE_att.Value = True Then
                                        Sheets("Removed large component").ChBx_RH_in_engine3.Value = False
                                        If OpB_nacelle_no.Value = True Then
                                            If OpB_tail_no.Value = True Then
                                                returnVal = MsgBox("Are you sure of this configuration ?" & vbCrLf & "" _
                                                & vbCrLf & "- All Landing Gears extended" _
                                                & vbCrLf & "- All Engines attached" _
                                                & vbCrLf & "- No Leaning on nacelle" _
                                                & vbCrLf & "- No Tail tipping", _
                                                vbYesNo + vbExclamation)
                                                If returnVal = vbYes Then
                                                    MsgBox ("Sorry! This program is only used for the typical scenarios."), vbCritical
                                                    Sheets("Start").Activate
                                                Else
                                                    OpB_NLG_ext.Value = False
                                                    OpB_LH_BLG_ext.Value = False
                                                    OpB_LH_WLG_ext.Value = False
                                                    OpB_RH_BLG_ext.Value = False
                                                    OpB_RH_WLG_ext.Value = False
                                                    OpB_LH_OE_att.Value = False
                                                    OpB_LH_IE_att.Value = False
                                                    OpB_RH_OE_att.Value = False
                                                    OpB_RH_IE_att.Value = False
                                                    OpB_nacelle_no.Value = False
                                                    OpB_tail_no.Value = False
                                                End If
                                            ElseIf OpB_tail_yes.Value = True Then
                                                returnVal = MsgBox("Are you sure of this configuration ?" & vbCrLf & "" _
                                                & vbCrLf & "- Tail tipping", _
                                                vbYesNo + vbExclamation)
                                                If returnVal = vbYes Then
                                                    MsgBox ("Sorry! This program

en faisant quelques petits calculs je me suis rendue compte que j'allais écrire énormement de ligne (je me suis arréter quand j'ai dépasser les 4000 lol)

je ne peux pas utiliser de modules car le code change a chaque fois ( le message d'erreur est different etc....)

je connais très peu la structure select case et je ne sait pas trop l'utiliser

quelqu'un pourrait-il m'aider soit sur la remise en forme de mon code de début en case soit pour un quelconque conseil ?

cela peut sembler confus donc n'hésiter pas a me poser des questions