Erreur d'éxécution 91 variable objet ou variable de bloc wit

Vonjour j'ai l erreur marquée dans le titre quand j'éxécutes le cde suivant

Dim ok As Boolean
Private Sub ComboBoxCodeGDO_Change()
    Dim Ligne As Long
    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).Value
    ComboBoxNomDépartHTA.Value = .Range("I" & Ligne).Value
    'ComboBoxCodeGDO.Value = .Range("J" & Ligne).Value
    ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
    ComboBoxCommune.Value = .Range("M" & Ligne).Value
    ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne).Value
    End With
    ok = False
    End Sub

LE programme fonctionne pour les valeurs premiers mais à la fin quend je sélectionne une valeur ça plante et ça m affiche l erreur

, ligne de plantage est ;

    Ligne = .Range("A2:N" & derlign).Find(ComboBoxCodeGDO, lookat:=xlWhole).Row

Bonjour

Essayes une autre manière de faire la recherche

Dim ok As Boolean
Private Sub ComboBoxCodeGDO_Change()
Dim Ligne As Long
Dim derlign As Long
Dim Cel As Range

  If ok = True Then Exit Sub
  With Sheets("Information2")
    derlign = .Range("A65536").End(xlUp).Row
    Set Cel = .Range("A2:N" & derlign).Find(What:=ComboBoxCodeGDO, lookat:=xlWhole)
    If Not Cel Is Nothing Then
      Ligne = Cel.Row
      ok = True
      ComboBoxCodeDépartHTA.Value = .Range("H" & Ligne).Value
      ComboBoxNomDépartHTA.Value = .Range("I" & Ligne).Value
      'ComboBoxCodeGDO.Value = .Range("J" & Ligne).Value
      ComboBoxNomPoste.Value = .Range("K" & Ligne).Value
      ComboBoxCommune.Value = .Range("M" & Ligne).Value
      ComboBoxSiteOpérationnel.Value = .Range("N" & Ligne).Value
    End If
  End With
  ok = False
End Sub

ça marche toujours pas, est ce que ça peut venir de cette ligne

 derlign = .Range("A65536").End(xlUp).Row

car j'ai beaucoup cellule vide dans la colonne A

Bonjour

Cela ne peut pas venir de cette ligne, car ton code fonctionne quelques fois avant de planter

ton fichier va être indispensable

Rechercher des sujets similaires à "erreur execution variable objet bloc wit"