IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Erreur d'éxécution '91' variable objet ou variable de bloc with non définie


Sujet :

Macros et VBA Excel

  1. #1
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut Erreur d'éxécution '91' variable objet ou variable de bloc with non définie
    Bonjour Tout le monde , j'ai ce code qui me permet de récupérer mes cellules dans mon formulaire ça marche bien mais à un moment ça plante et ça m'affiche l'erreur dans le titre
    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
    Dim ok As Boolean
    Private Sub ComboBoxCodeGDO_Change()
        Dim Ligne As Integer
        Dim derlign As Long
        If ok = True Then Exit Sub
        With Sheets("Information2")
        derlign = .Range("A65536").End(xlUp).Row
        Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row
        ok = True
        ComboBoxCodeDépartHTA.Value = .Range("H" & Ligne)
        ComboBoxNomDépartHTA.Value = .Range("I" & Ligne)
        'ComboBoxCodeGDO.Value = .Range("J" & Ligne)
        ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
        ComboBoxCommune.Value = .Range("M" & Ligne).Value
        ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne)
        End With
        ok = False
        End Sub
    sachant que j'ai dans ma feuille plus que 20 000 lignes est il vient de al déclaration des variables

  2. #2
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    Apprends à donner la ligne de plantage du code Dernière fois.

  3. #3
    Expert éminent Avatar de casefayere
    Homme Profil pro
    RETRAITE
    Inscrit en
    Décembre 2006
    Messages
    5 138
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 69
    Localisation : France, Ardennes (Champagne Ardenne)

    Informations professionnelles :
    Activité : RETRAITE
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : Décembre 2006
    Messages : 5 138
    Points : 9 548
    Points
    9 548
    Par défaut
    Tu gères plusieurs problèmes en même temps sans avoir répondu, au moins à celui-ci
    Cordialement,
    Dom
    _____________________________________________
    Vous êtes nouveau ? pour baliser votre code, cliquer sur cet exemple : Anomaly
    pensez à cliquer sur si votre problème l'est
    Par contre, il est désagréable de voir une discussion résolue sans message final du demandeur (satisfaction, désarroi, remerciement, conclusion...)

  4. #4
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    Je vais en répondre, la je m'occupe plus pour faire fonctionner le formulaire avec les doublons ensuite je m occuperai des doublons.

    c'est cette ligne qui plante , et déclarer ligne en long ça résout pas le problème
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
        Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row

  5. #5
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    S'il ne trouve pas ton codeGDO il plante... normal tu demandes la row de nothing

    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
    Dim ok As Boolean
    Private Sub ComboBoxCodeGDO_Change()
        Dim Ligne As Integer
        Dim derlign As Long
        On Error GoTo pastrouvé
        If ok = True Then Exit Sub
        With Sheets("Information2")
        derlign = .Range("A65536").End(xlUp).Row
        Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row
        ok = True
        ComboBoxCodeDépartHTA.Value = .Range("H" & Ligne)
        ComboBoxNomDépartHTA.Value = .Range("I" & Ligne)
        'ComboBoxCodeGDO.Value = .Range("J" & Ligne)
        ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
        ComboBoxCommune.Value = .Range("M" & Ligne).Value
        ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne)
        End With
        ok = False
    pastrouvé:
        MsgBox ("CodeGDO non présent")
        End Sub

  6. #6
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    Pourquoi , il le trouve alors que je récupère les cellules de tableau excel donc certainement il existe, quand je regarde ma feuille j'ai bien tous les GDO Mais ç actualise pas mes menus alors que d'autres les menus s'actualisent

  7. #7
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    Si tu utilises l'évenement initialize pour actualiser tes userforms, tant que tu ne le Unloads pas, il ne va pas se réinitializer.

  8. #8
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    je vous mets le code d'initialisation car je comprends pas trop ou est l erreur

    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
    Private Sub UserForm_Initialize()
    'Macro dan 16/05/12
    Dim Modèle
    Dim Constructeurs
    Dim Technologie
    Dim PPI
    Dim Etat
    Dim ILD
    Dim Résultat
    Dim Année
    Dim modification
    Dim GDO
    With Sheets("Information2")
    GDO = .Range("J2:J" & .Range("J" & Rows.Count).End(xlUp).Row)
    End With
    With Sheets("Information")
    Modèle = .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
    Constructeurs = .Range("B2:B" & .Range("B" & Rows.Count).End(xlUp).Row)
    Technologie = .Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row)
    ILD = .Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row)
    Etat = .Range("F2:F" & .Range("F" & Rows.Count).End(xlUp).Row)
    PPI = .Range("H2:H" & .Range("H" & Rows.Count).End(xlUp).Row)
    Année = .Range("J2:J" & .Range("J" & Rows.Count).End(xlUp).Row)
    modification = .Range("K2:K" & .Range("K" & Rows.Count).End(xlUp).Row)
    Résultat = .Range("I2:I" & .Range("I" & Rows.Count).End(xlUp).Row)
    End With
    ComboBoxCodeGDO.List() = GDO
    ComboBoxModèle.List() = Modèle
    ComboBoxConstructeur.List() = Constructeurs
    ComboBoxTechnologie.List() = Technologie
    ComboBoxPPI.List() = PPI
    ComboBoxRésultat.List() = Résultat
    ComboBoxBatterie.List() = Etat
    ComboBoxVoyant.List() = Etat
    ComboBoxTorres.List() = Etat
    ComboBoxPlatine.List() = Etat
    ComboBoxTypeILD.List() = ILD
    ComboBoxAnnéeBatterie.List() = Année
    ComboBoxDateControle.List() = Année
    ComboBoxAnnéeControleValise.List() = Année
    ComboBoxModificationSchémas.List() = modification
    End Sub

  9. #9
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    .... Discours de sourds, je laisse tomber.

  10. #10
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    Mais j'ai pas compris , ça fait 3 jours que je travaille sur les formulaires à base de vba j'ai jamais fait auparavant Donc je comprends pas ce que vous dites upload je ne sais pas ou le placer

  11. #11
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    Alors admetons que tu actualises avec un autre formulaire ton classeur..
    Et que tu es déjà passé par ce formulaire.
    TANT QUE TU NE LE VIRES PAS DE LA MEMOIRE
    CEST A DIRE: TANT QUE TU NE LE UNLOADS PAS
    ta combobox ne va pas se reactualiser puisque le initialize ne va pas se recharger..

    Et donc tu vas demander le row d'un nothing et ça va planter.

    Il me faudrait TOUS tes formulaires et tout ton code pour pouvoir te le débeuguer.

  12. #12
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    Je vous envois le code de mes deux formulaires car le classeur est volumineux j'arrive pas à le joindre

    Formulaire pour enregistrer :

    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
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    Dim ok As Boolean
    Private Sub ComboBoxCodeGDO_Change()
        Dim Ligne As Integer
        Dim derlign As Long
        'On Error GoTo pastrouvé
        If ok = True Then Exit Sub
        With Sheets("Information2")
        derlign = .Range("A65536").End(xlUp).Row
        Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row
        ok = True
        ComboBoxCodeDépartHTA.Value = .Range("H" & Ligne)
        ComboBoxNomDépartHTA.Value = .Range("I" & Ligne)
        'ComboBoxCodeGDO.Value = .Range("J" & Ligne)
        ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
        ComboBoxCommune.Value = .Range("M" & Ligne).Value
        ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne)
        End With
        ok = False
    'pastrouvé:
        'MsgBox ("CodeGDO non présent")
        End Sub
     
     
    Private Sub CommandButtonAjouter_Click()
    num = Sheets("Remplissage").Range("A65536").End(xlUp).Row + 1
    Sheets("Remplissage").Activate
        If Formulaire.ComboBoxCodeDépartHTA.Text = "" Then
           MsgBox "Vous devez entrer le code départ HTA."
           Formulaire.ComboBoxCodeDépartHTA.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxNomDépartHTA.Text = "" Then
           MsgBox "Vous devez entrer le nom du départ HTA."
           Formulaire.ComboBoxNomDépartHTA.SetFocus
        Exit Sub
        End If
        If Formulaire.TextExploit.Text = "" Then
           MsgBox "Vous devez entrer le pôle exploitation."
           Formulaire.TextExploit.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxCodeGDO.Text = "" Then
           MsgBox "Vous devez entrer le code GDO."
           Formulaire.ComboBoxCodeGDO.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxPPI.Text = "" Then
           MsgBox "Vous devez entrer le rang de PPI."
           Formulaire.ComboBoxPPI.SetFocus
        Exit Sub
        End If
     
        If Formulaire.ComboBoxNomPoste.Text = "" Then
           MsgBox "Vous devez entrer le nom du poste."
           Formulaire.ComboBoxNomPoste.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxCommune.Text = "" Then
            MsgBox "Vous devez entrer le nom de la commune."
            Formulaire.ComboBoxCommune.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxModèle.Text = "" Then
           MsgBox "Vous devez entrer le modèle de L'ILD."
           Formulaire.ComboBoxModèle.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxConstructeur.Text = "" Then
           MsgBox "Vous devez entrer le nom du constructeur."
           Formulaire.ComboBoxConstructeur.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxTechnologie.Text = "" Then
           MsgBox "Vous devez entrer la technologie de L'ILD."
           Formulaire.ComboBoxTechnologie.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxTypeILD.Text = "" Then
           MsgBox "Vous devez entrer le Type de l'ILD."
           Formulaire.TypeILD.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxAnnéeBatterie.Text = "" Then
           MsgBox "Vous devez entrer l'année de la fabrication de la batterie."
           Formulaire.ComboBoxAnnéeBatterie.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxDateControle.Text = "" Then
           MsgBox "Vous devez entrer la date de contrôle de l'ILD."
           Formulaire.ComboBoxDateControle.SetFocus
        Exit Sub
        End If
        If Formulaire.TextGéocutil.Text = "" Then
           MsgBox "Vous devez entrer l'ILD présent coté (sur le schémas Géocutil)."
           Formulaire.TextGéocutil.SetFocus
        Exit Sub
        End If
        If Formulaire.TextTerrain.Text = "" Then
           MsgBox "Vous devez entrer l'ILD présent coté (sur le terrain)."
           Formulaire.TextTerrain.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxBatterie.Text = "" Then
           MsgBox "Vous devez entrer l'etat de la batterie."
           Formulaire.ComboBoxBatterie.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxPlatine.Text = "" Then
           MsgBox "Vous devez entrer l'état de la platine."
           Formulaire.ComboBoxPlatine.SetFocus
        Exit Sub
        End If
          If Formulaire.ComboBoxVoyant = "" Then
           MsgBox "Vous devez entrer l'état du voyant."
           Formulaire.ComboBoxVoyant.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxTorres.Text = "" Then
           MsgBox "Vous devez entrer l'état des torres."
           Formulaire.ComboBoxTorres.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxModificationSchémas.Text = "" Then
           MsgBox "Vous devez signaler si le schéma ACR est à modifier ?."
           Formulaire.ComboBoxModificationSchémas.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxSiteOpérationnel.Text = "" Then
           MsgBox "Vous devez entrer le site opérationnel."
           Formulaire.ComboBoxSiteOpérationnel.SetFocus
        Exit Sub
        End If
        If Formulaire.ComboBoxRésultat.Text = "" Then
           MsgBox "Vous devez signaler le résultat de contrôle de l'ILD."
           Formulaire.ComboBoxRésultat.SetFocus
        Exit Sub
        End If
        If Formulaire.TextActionUltérieurement.Text = "" Then
           MsgBox "Vous devez signaler l'action à réaliser iltérieurement."
           Formulaire.TextActionUltérieurement.SetFocus
        Exit Sub
        End If
        If Formulaire.TextActionVisite.Text = "" Then
           MsgBox "Vous devez signaler l'action réalisé lors de la visite."
           Formulaire.TextActionVisite.SetFocus
        Exit Sub
        End If
    With Sheets("Remplissage")
        For Each cell In .Range("D3:D" & .Range("D65536").End(xlUp).Row)
            If Not cell = ComboBoxCodeGDO Then
                Range("A" & num).Value = ComboBoxCodeDépartHTA
                Range("B" & num).Value = ComboBoxNomDépartHTA
                Range("C" & num).Value = TextExploit
                Range("D" & num).Value = ComboBoxCodeGDO
                Range("E" & num).Value = Formulaire.ComboBoxPPI
                Range("F" & num).Value = ComboBoxNomPoste
                Range("G" & num).Value = ComboBoxCommune
                Range("H" & num).Value = Formulaire.ComboBoxModèle
                Range("I" & num).Value = Formulaire.ComboBoxConstructeur
                Range("J" & num).Value = Formulaire.ComboBoxTechnologie
                Range("K" & num).Value = Formulaire.ComboBoxTypeILD
                Range("L" & num).Value = Formulaire.ComboBoxAnnéeBatterie
                Range("M" & num).Value = TextCalibrePossible.Value
                Range("N" & num).Value = TextRéglageEffectif.Value
                Range("O" & num).Value = TextRéglagePréconisé.Value
                Range("P" & num).Value = Formulaire.ComboBoxDateControle
                Range("Q" & num).Value = Formulaire.ComboBoxAnnéeControleValise
                Range("R" & num).Value = TextGéocutil.Value
                Range("S" & num).Value = TextTerrain.Value
                Range("T" & num).Value = Formulaire.ComboBoxBatterie
                Range("U" & num).Value = Formulaire.ComboBoxPlatine
                Range("V" & num).Value = Formulaire.ComboBoxVoyant
                Range("W" & num).Value = Formulaire.ComboBoxTorres
                Range("X" & num).Value = Formulaire.ComboBoxModificationSchémas
                Range("Y" & num).Value = TextContenuACR.Value
                Range("Z" & num).Value = TextActionVisite.Value
                Range("AA" & num).Value = TextActionUltérieurement.Value
                Range("AB" & num).Value = Formulaire.ComboBoxSiteOpérationnel
                Range("AC" & num).Value = Formulaire.ComboBoxRésultat
        Exit For
     
            Else
                Modif = MsgBox("cette personne est déjà référencée dans la base" & Chr(10) & Chr(10) & _
                        "Voulez-vous remplacer ces données ?", vbYesNo + vbQuestion, "Demande d'enregistrement")
                ' On remplace la somme et le commentaire
                    If Modif = vbYes Then
                        Range("A" & num).Value = ComboBoxCodeDépartHTA
                        Range("B" & num).Value = ComboBoxNomDépartHTA
                        Range("C" & num).Value = TextExploit
                        Range("D" & num).Value = ComboBoxCodeGDO
                        Range("E" & num).Value = Formulaire.ComboBoxPPI
                        Range("F" & num).Value = ComboBoxNomPoste
                        Range("G" & num).Value = ComboBoxCommune
                        Range("H" & num).Value = Formulaire.ComboBoxModèle
                        Range("I" & num).Value = Formulaire.ComboBoxConstructeur
                        Range("J" & num).Value = Formulaire.ComboBoxTechnologie
                        Range("K" & num).Value = Formulaire.ComboBoxTypeILD
                        Range("L" & num).Value = Formulaire.ComboBoxAnnéeBatterie
                        Range("M" & num).Value = TextCalibrePossible.Value
                        Range("N" & num).Value = TextRéglageEffectif.Value
                        Range("O" & num).Value = TextRéglagePréconisé.Value
                        Range("P" & num).Value = Formulaire.ComboBoxDateControle
                        Range("Q" & num).Value = Formulaire.ComboBoxAnnéeControleValise
                        Range("R" & num).Value = TextGéocutil.Value
                        Range("S" & num).Value = TextTerrain.Value
                        Range("T" & num).Value = Formulaire.ComboBoxBatterie
                        Range("U" & num).Value = Formulaire.ComboBoxPlatine
                        Range("V" & num).Value = Formulaire.ComboBoxVoyant
                        Range("W" & num).Value = Formulaire.ComboBoxTorres
                        Range("X" & num).Value = Formulaire.ComboBoxModificationSchémas
                        Range("Y" & num).Value = TextContenuACR.Value
                        Range("Z" & num).Value = TextActionVisite.Value
                        Range("AA" & num).Value = TextActionUltérieurement.Value
                        Range("AB" & num).Value = Formulaire.ComboBoxSiteOpérationnel
                        Range("AC" & num).Value = Formulaire.ComboBoxRésultat
                    Exit For
                    End If
                    If Modif = vbNo Then
                        Exit For
                    End If
            End If
        Next
    End With
    Me.ComboBoxCodeDépartHTA = ""
    Me.ComboBoxNomDépartHTA = ""
    Me.TextExploit = ""
    Me.ComboBoxCodeGDO = ""
    Me.ComboBoxNomPoste = ""
    Me.ComboBoxCommune = ""
    Me.ComboBoxAnnéeBatterie = ""
    Me.ComboBoxAnnéeControleValise = ""
    Me.TextCalibrePossible = ""
    Me.TextRéglageEffectif = ""
    Me.TextRéglagePréconisé = ""
    Me.ComboBoxDateControle = ""
    Me.TextGéocutil = ""
    Me.ComboBoxModificationSchémas = ""
    Me.TextContenuACR = ""
    Me.TextActionVisite = ""
    Me.TextActionUltérieurement = ""
    Me.ComboBoxSiteOpérationnel = ""
    Me.ComboBoxBatterie = ""
    Me.ComboBoxConstructeur = ""
    Me.ComboBoxModèle = ""
    Me.ComboBoxPlatine = ""
    Me.ComboBoxTorres = ""
    Me.ComboBoxPPI = ""
    Me.ComboBoxRésultat = ""
    Me.ComboBoxTechnologie = ""
    Me.ComboBoxTypeILD = ""
    Me.ComboBoxVoyant = ""
    End Sub
     
    Private Sub CommandButtonAnnuler_Click()
    Me.ComboBoxCodeDépartHTA = ""
    Me.ComboBoxNomDépartHTA = ""
    Me.TextExploit = ""
    Me.ComboBoxCodeGDO = ""
    Me.ComboBoxNomPoste = ""
    Me.ComboBoxCommune = ""
    Me.ComboBoxAnnéeBatterie = ""
    Me.ComboBoxAnnéeControleValise = ""
    Me.TextCalibrePossible = ""
    Me.TextRéglageEffectif = ""
    Me.TextRéglagePréconisé = ""
    Me.ComboBoxDateControle = ""
    Me.TextGéocutil = ""
    Me.ComboBoxModificationSchémas = ""
    Me.TextContenuACR = ""
    Me.ComboBoxTorres = ""
    Me.TextActionVisite = ""
    Me.TextActionUltérieurement = ""
    Me.ComboBoxSiteOpérationnel = ""
    Me.ComboBoxBatterie = ""
    Me.ComboBoxConstructeur = ""
    Me.ComboBoxModèle = ""
    Me.ComboBoxPlatine = ""
    Me.ComboBoxPPI = ""
    Me.ComboBoxRésultat = ""
    Me.ComboBoxTechnologie = ""
    Me.ComboBoxTypeILD = ""
    Me.ComboBoxVoyant = ""
    End Sub
    Private Sub CommandButtonQuitter_Click()
    If MsgBox("Etes-vous certain de vouloir quitter l'application ?", vbYesNo, "Demande de confirmation") = vbYes Then
        Unload Formulaire
        End If
    End Sub
     
     
    Private Sub UserForm_Initialize()
     
    'Macro dan 16/05/12
    Dim Modèle
    Dim Constructeurs
    Dim Technologie
    Dim PPI
    Dim Etat
    Dim ILD
    Dim Résultat
    Dim Année
    Dim modification
    Dim GDO
    With Sheets("Information2")
    GDO = .Range("J2:J" & .Range("J" & Rows.Count).End(xlUp).Row)
    End With
    With Sheets("Information")
    Modèle = .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
    Constructeurs = .Range("B2:B" & .Range("B" & Rows.Count).End(xlUp).Row)
    Technologie = .Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row)
    ILD = .Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row)
    Etat = .Range("F2:F" & .Range("F" & Rows.Count).End(xlUp).Row)
    PPI = .Range("H2:H" & .Range("H" & Rows.Count).End(xlUp).Row)
    Année = .Range("J2:J" & .Range("J" & Rows.Count).End(xlUp).Row)
    modification = .Range("K2:K" & .Range("K" & Rows.Count).End(xlUp).Row)
    Résultat = .Range("I2:I" & .Range("I" & Rows.Count).End(xlUp).Row)
    End With
    ComboBoxCodeGDO.List() = GDO
    ComboBoxModèle.List() = Modèle
    ComboBoxConstructeur.List() = Constructeurs
    ComboBoxTechnologie.List() = Technologie
    ComboBoxPPI.List() = PPI
    ComboBoxRésultat.List() = Résultat
    ComboBoxBatterie.List() = Etat
    ComboBoxVoyant.List() = Etat
    ComboBoxTorres.List() = Etat
    ComboBoxPlatine.List() = Etat
    ComboBoxTypeILD.List() = ILD
    ComboBoxAnnéeBatterie.List() = Année
    ComboBoxDateControle.List() = Année
    ComboBoxAnnéeControleValise.List() = Année
    ComboBoxModificationSchémas.List() = modification
     
    End Sub
    Formulaire pour modifier

    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
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
     
        Dim ok As Boolean
        Private Sub ComboBoxCodeGDO_Change()
        Dim Ligne As Integer
        Dim derlign As Long
        If ok = True Then Exit Sub
        With Sheets("Remplissage")
        derlign = .Range("A65536").End(xlUp).Row
        Ligne = .Range("A3:AC" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row
        ok = True
        ComboBoxCodeDépartHTA.Value = .Range("A" & Ligne)
        ComboBoxNomDépartHTA.Value = .Range("B" & Ligne)
        TextExploit.Value = .Range("C" & Ligne)
        ComboBoxCodeGDO.Value = .Range("D" & Ligne)
        ComboBoxPPI.Value = .Range("E" & Ligne)
        ComboBoxNomPoste.Value = .Range("F" & Ligne).Value
        ComboBoxCommune.Value = .Range("G" & Ligne).Value
        ComboBoxModèle.Value = .Range("H" & Ligne)
        ComboBoxConstructeur.Value = .Range("I" & Ligne)
        ComboBoxTechnologie.Value = .Range("J" & Ligne)
        ComboBoxTypeILD.Value = .Range("K" & Ligne)
        ComboBoxAnnéeBatterie.Value = .Range("L" & Ligne)
        TextCalibrePossible.Value = .Range("M" & Ligne)
        TextRéglageEffectif.Value = .Range("N" & Ligne)
        TextRéglagePréconisé.Value = .Range("O" & Ligne)
        ComboBoxDateControle.Value = .Range("P" & Ligne)
        ComboBoxAnnéeControleValise.Value = .Range("Q" & Ligne)
        TextGéocutil.Value = .Range("R" & Ligne)
        TextTerrain.Value = .Range("S" & Ligne)
        ComboBoxBatterie.Value = .Range("T" & Ligne)
        ComboBoxPlatine.Value = .Range("U" & Ligne)
        ComboBoxVoyant.Value = .Range("V" & Ligne)
        ComboBoxTorres.Value = .Range("W" & Ligne)
        ComboBoxModificationSchémas.Value = .Range("X" & Ligne)
        TextContenuACR.Value = .Range("Y" & Ligne)
        TextActionVisite.Value = .Range("Z" & Ligne)
        TextActionUltérieurement.Value = .Range("AA" & Ligne)
        ComboBoxSiteOpérationnel.Value = .Range("AB" & Ligne)
        ComboBoxRésultat.Value = .Range("AC" & Ligne)
        End With
        ok = False
        End Sub
     
    Private Sub CommandButtonModifier_Click()
    Sheets("Remplissage").Activate
        If Formulaire1.ComboBoxCodeDépartHTA.Text = "" Then
           MsgBox "Vous devez entrer le code départ HTA."
           Formulaire1.ComboBoxCodeDépartHTA.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxNomDépartHTA.Text = "" Then
           MsgBox "Vous devez entrer le nom du départ HTA."
           Formulaire1.ComboBoxNomDépartHTA.SetFocus
        Exit Sub
        End If
        If Formulaire1.TextExploit.Text = "" Then
           MsgBox "Vous devez entrer le pôle exploitation."
           Formulaire1.TextExploit.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxCodeGDO.Text = "" Then
           MsgBox "Vous devez entrer le code GDO."
           Formulaire1.ComboBoxCodeGDO.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxPPI.Text = "" Then
           MsgBox "Vous devez entrer le rang de PPI."
           Formulaire1.ComboBoxPPI.SetFocus
        Exit Sub
        End If
     
        If Formulaire1.ComboBoxNomPoste.Text = "" Then
           MsgBox "Vous devez entrer le nom du poste."
           Formulaire1.ComboBoxNomPoste.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxCommune.Text = "" Then
            MsgBox "Vous devez entrer le nom de la commune."
            Formulaire1.ComboBoxCommune.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxModèle.Text = "" Then
           MsgBox "Vous devez entrer le modèle de L'ILD."
           Formulaire1.ComboBoxModèle.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxConstructeur.Text = "" Then
           MsgBox "Vous devez entrer le nom du constructeur."
           Formulaire1.ComboBoxConstructeur.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxTechnologie.Text = "" Then
           MsgBox "Vous devez entrer la technologie de L'ILD."
           Formulaire1.ComboBoxTechnologie.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxTypeILD.Text = "" Then
           MsgBox "Vous devez entrer le Type de l'ILD."
           Formulaire1.TypeILD.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxAnnéeBatterie.Text = "" Then
           MsgBox "Vous devez entrer l'année de la fabrication de la batterie."
           Formulaire1.ComboBoxAnnéeBatterie.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxDateControle.Text = "" Then
           MsgBox "Vous devez entrer la date de contrôle de l'ILD."
           Formulaire1.ComboBoxDateControle.SetFocus
        Exit Sub
        End If
        If Formulaire1.TextGéocutil.Text = "" Then
           MsgBox "Vous devez entrer l'ILD présent coté (sur le schémas Géocutil)."
           Formulaire1.TextGéocutil.SetFocus
        Exit Sub
        End If
        If Formulaire1.TextTerrain.Text = "" Then
           MsgBox "Vous devez entrer l'ILD présent coté (sur le terrain)."
           Formulaire1.TextTerrain.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxBatterie.Text = "" Then
           MsgBox "Vous devez entrer l'etat de la batterie."
           Formulaire1.ComboBoxBatterie.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxPlatine.Text = "" Then
           MsgBox "Vous devez entrer l'état de la platine."
           Formulaire1.ComboBoxPlatine.SetFocus
        Exit Sub
        End If
          If Formulaire1.ComboBoxVoyant = "" Then
           MsgBox "Vous devez entrer l'état du voyant."
           Formulaire1.ComboBoxVoyant.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxTorres.Text = "" Then
           MsgBox "Vous devez entrer l'état des torres."
           Formulaire1.ComboBoxTorres.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxModificationSchémas.Text = "" Then
           MsgBox "Vous devez signaler si le schéma ACR est à modifier ?."
           Formulaire1.ComboBoxModificationSchémas.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxSiteOpérationnel.Text = "" Then
           MsgBox "Vous devez entrer le site opérationnel."
           Formulaire1.ComboBoxSiteOpérationnel.SetFocus
        Exit Sub
        End If
        If Formulaire1.ComboBoxRésultat.Text = "" Then
           MsgBox "Vous devez signaler le résultat de contrôle de l'ILD."
           Formulaire1.ComboBoxRésultat.SetFocus
        Exit Sub
        End If
        If Formulaire1.TextActionUltérieurement.Text = "" Then
           MsgBox "Vous devez signaler le résultat de contrôle de l'ILD."
           Formulaire1.TextActionUltérieurement.SetFocus
        Exit Sub
        End If
        If Formulaire1.TextActionVisite.Text = "" Then
           MsgBox "Vous devez signaler le résultat de contrôle de l'ILD."
           Formulaire1.TextActionVisite.SetFocus
        Exit Sub
        End If
    Dim Ligne As Long
    Dim Cel As Range
      With Sheets("Remplissage")
        Set Cel = .Columns("D").Find(what:=Me.ComboBoxCodeGDO, LookIn:=xlValues, lookat:=xlWhole)
        If Not Cel Is Nothing Then
        Ligne = Cel.Row
        If MsgBox("Voulez-vous modifier les informations de " & Me.ComboBoxCodeGDO & " ?", _
                          vbQuestion + vbYesNo, "Modification") <> vbYes Then Exit Sub
    .Range("A" & Ligne).Value = ComboBoxCodeDépartHTA
    .Range("B" & Ligne).Value = ComboBoxNomDépartHTA
    .Range("C" & Ligne).Value = TextExploit
    .Range("D" & Ligne).Value = ComboBoxCodeGDO
    .Range("E" & Ligne).Value = Formulaire1.ComboBoxPPI
    .Range("F" & Ligne).Value = ComboBoxNomPoste
    .Range("G" & Ligne).Value = ComboBoxCommune
    .Range("H" & Ligne).Value = Formulaire1.ComboBoxModèle
    .Range("I" & Ligne).Value = Formulaire1.ComboBoxConstructeur
    .Range("J" & Ligne).Value = Formulaire1.ComboBoxTechnologie
    .Range("K" & Ligne).Value = Formulaire1.ComboBoxTypeILD
    .Range("L" & Ligne).Value = Formulaire1.ComboBoxAnnéeBatterie
    .Range("M" & Ligne).Value = TextCalibrePossible.Value
    .Range("N" & Ligne).Value = TextRéglageEffectif.Value
    .Range("O" & Ligne).Value = TextRéglagePréconisé.Value
    .Range("P" & Ligne).Value = Formulaire1.ComboBoxDateControle
    .Range("Q" & Ligne).Value = Formulaire1.ComboBoxAnnéeControleValise
    .Range("R" & Ligne).Value = TextGéocutil.Value
    .Range("S" & Ligne).Value = TextTerrain.Value
    .Range("T" & Ligne).Value = Formulaire1.ComboBoxBatterie
    .Range("U" & Ligne).Value = Formulaire1.ComboBoxPlatine
    .Range("V" & Ligne).Value = Formulaire1.ComboBoxVoyant
    .Range("W" & Ligne).Value = Formulaire1.ComboBoxTorres
    .Range("X" & Ligne).Value = Formulaire1.ComboBoxModificationSchémas
    .Range("Y" & Ligne).Value = TextContenuACR.Value
    .Range("Z" & Ligne).Value = TextActionVisite.Value
    .Range("AA" & Ligne).Value = TextActionUltérieurement.Value
    .Range("AB" & Ligne).Value = Formulaire1.ComboBoxSiteOpérationnel
    .Range("AC" & Ligne).Value = Formulaire1.ComboBoxRésultat
    End If
    End With
    Me.ComboBoxCodeDépartHTA = ""
    Me.ComboBoxNomDépartHTA = ""
    Me.TextExploit = ""
    Me.ComboBoxCodeGDO = ""
    Me.ComboBoxNomPoste = ""
    Me.ComboBoxCommune = ""
    Me.ComboBoxAnnéeBatterie = ""
    Me.ComboBoxAnnéeControleValise = ""
    Me.TextCalibrePossible = ""
    Me.TextRéglageEffectif = ""
    Me.TextRéglagePréconisé = ""
    Me.ComboBoxDateControle = ""
    Me.TextGéocutil = ""
    Me.ComboBoxModificationSchémas = ""
    Me.TextContenuACR = ""
    Me.TextActionVisite = ""
    Me.TextActionUltérieurement = ""
    Me.ComboBoxSiteOpérationnel = ""
    Me.ComboBoxBatterie = ""
    Me.ComboBoxTorres = ""
    Me.ComboBoxConstructeur = ""
    Me.ComboBoxModèle = ""
    Me.ComboBoxPlatine = ""
    Me.ComboBoxPPI = ""
    Me.ComboBoxRésultat = ""
    Me.ComboBoxTechnologie = ""
    Me.ComboBoxTypeILD = ""
    Me.ComboBoxVoyant = ""
    End Sub
     
    Private Sub CommandButtonAnnuler_Click()
    Me.ComboBoxCodeDépartHTA = ""
    Me.ComboBoxNomDépartHTA = ""
    Me.TextExploit = ""
    Me.ComboBoxCodeGDO = ""
    Me.ComboBoxNomPoste = ""
    Me.ComboBoxCommune = ""
    Me.ComboBoxAnnéeBatterie = ""
    Me.ComboBoxAnnéeControleValise = ""
    Me.TextCalibrePossible = ""
    Me.TextRéglageEffectif = ""
    Me.TextRéglagePréconisé = ""
    Me.ComboBoxDateControle = ""
    Me.TextGéocutil = ""
    Me.ComboBoxModificationSchémas = ""
    Me.TextContenuACR = ""
    Me.TextActionVisite = ""
    Me.TextActionUltérieurement = ""
    Me.ComboBoxSiteOpérationnel = ""
    Me.ComboBoxBatterie = ""
    Me.ComboBoxConstructeur = ""
    Me.ComboBoxModèle = ""
    Me.ComboBoxPlatine = ""
    Me.ComboBoxPPI = ""
    Me.ComboBoxTorres = ""
    Me.ComboBoxRésultat = ""
    Me.ComboBoxTechnologie = ""
    Me.ComboBoxTypeILD = ""
    Me.ComboBoxVoyant = ""
    End Sub
    Private Sub CommandButtonQuitter_Click()
    If MsgBox("Etes-vous certain de vouloir quitter l'application ?", vbYesNo, "Demande de confirmation") = vbYes Then
        Unload Formulaire1
        End If
    End Sub
     
    Private Sub CommandButtonSupprimer_Click()
     If MsgBox("Etes-vous certain de vouloir supprimer le PPI de " & ComboBoxCodeGDO.Text, vbQuestion + vbYesNo) Then
        Sheets("Remplissage").Rows(ComboBoxCodeGDO.ListIndex + 3).Delete Shift:=xlUp
        End If
    End Sub
     
    Private Sub UserForm_Initialize()
    Dim Modèle
    Dim Constructeurs
    Dim Technologie
    Dim PPI
    Dim Site
    Dim Etat
    Dim ILD
    Dim Résultat
    Dim Année
    Dim modification
    Dim CodeGDO
    CodeGDO = Sheets("Remplissage").Range("D3:D" & Sheets("Remplissage").Range("D" & Rows.Count).End(xlUp).Row)
    With Sheets("Information")
    Modèle = .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
    Constructeurs = .Range("B2:B" & .Range("B" & Rows.Count).End(xlUp).Row)
    Technologie = .Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row)
    ILD = .Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row)
    Etat = .Range("F2:F" & .Range("F" & Rows.Count).End(xlUp).Row)
    Site = .Range("G2:G" & .Range("G" & Rows.Count).End(xlUp).Row)
    PPI = .Range("H2:H" & .Range("H" & Rows.Count).End(xlUp).Row)
    Année = .Range("J2:J" & .Range("J" & Rows.Count).End(xlUp).Row)
    modification = .Range("K2:K" & .Range("K" & Rows.Count).End(xlUp).Row)
    Résultat = .Range("I2:I" & .Range("I" & Rows.Count).End(xlUp).Row)
    End With
    ComboBoxCodeGDO.List() = CodeGDO
    ComboBoxModèle.List() = Modèle
    ComboBoxConstructeur.List() = Constructeurs
    ComboBoxTechnologie.List() = Technologie
    ComboBoxPPI.List() = PPI
    ComboBoxRésultat.List() = Résultat
    ComboBoxSiteOpérationnel.List() = Site
    ComboBoxBatterie.List() = Etat
    ComboBoxVoyant.List() = Etat
    ComboBoxTorres.List() = Etat
    ComboBoxPlatine.List() = Etat
    ComboBoxTypeILD.List() = ILD
    ComboBoxAnnéeBatterie.List() = Année
    ComboBoxDateControle.List() = Année
    ComboBoxAnnéeControleValise.List() = Année
    ComboBoxModificationSchémas.List() = modification
    End Sub
    J'ai supprimé des données Vous trouvez ci joint le classeur
    Fichiers attachés Fichiers attachés

  13. #13
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    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
    Private Sub ComboBoxCodeGDO_Change()
        Dim Ligne As Integer
        Dim derlign As Long
        'On Error GoTo pastrouvé
        If ok = True Then Exit Sub
        With Sheets("Information2")
        derlign = .Range("J65536").End(xlUp).Row
        Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row
        ok = True
        ComboBoxCodeDépartHTA.Value = .Range("H" & Ligne)
        ComboBoxNomDépartHTA.Value = .Range("I" & Ligne)
        'ComboBoxCodeGDO.Value = .Range("J" & Ligne)
        ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
        ComboBoxCommune.Value = .Range("M" & Ligne).Value
        ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne)
        End With
        ok = False
    'pastrouvé:
        'MsgBox ("CodeGDO non présent")
        End Sub

  14. #14
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    La feuille remplissage pour saisir mes données et Information2 contient les données que je récupère dans les menu déroulants .

  15. #15
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    Prends l'habitude de regarder tes indices quand sa beugue tu comprendras d'ou vient l'erreur.. N'ayant aucune donnée en colonne A dernligne valait 1 et donc ça ne trouvait pas ta valeur dans ton find. Normal quoi.

  16. #16
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    J'ai mis
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
      derlign = .Range("D65536").End(xlUp).Row
    et ça marche toujours pas

  17. #17
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    Oh!!!!!!! Tu fais exprès ou quoi
    JE PRENDS DE MON TEMPS POUR T'AIDER ET TU N'EN FAIS QU'A TA TETE ?

    LA MOINDRE DES CHOSES EST DE TESTER MON CODE AVANT DE L'OUVRIR.

    BYE

  18. #18
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    Mais tu as quoi j'ai testé ton code et j'ai le même erreur , ne crie pas sur moi on se connait pas calmes toi

  19. #19
    Inactif  
    Homme Profil pro
    Inscrit en
    Septembre 2012
    Messages
    1 733
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2012
    Messages : 1 733
    Points : 2 553
    Points
    2 553
    Par défaut
    derlign = .Range("J65536").End(xlUp).Row

    .... AVEUGLE

  20. #20
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    377
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Janvier 2013
    Messages : 377
    Points : 71
    Points
    71
    Par défaut
    En plus tu m as envoyé aucun code

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Erreur (91) variable objet ou variable de bloc with non définie
    Par BENNASR dans le forum Macros et VBA Excel
    Réponses: 8
    Dernier message: 17/12/2014, 15h22
  2. Réponses: 4
    Dernier message: 24/05/2014, 19h24
  3. Erreur 91 : variable objet ou variable de bloc with non définie
    Par blobsam dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 18/08/2011, 17h19
  4. [XL-2007] Message d'erreur : Variable objet ou Variable de bloc With non définie
    Par toushusss dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 14/06/2011, 10h02
  5. erreur 91 variable objet ou variable de bloc with non définie
    Par ballantine's dans le forum Macros et VBA Excel
    Réponses: 24
    Dernier message: 03/12/2009, 16h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo