Membre de méthode ou de données introuvable

Résolu
Bonjour,
Quand je cherche a utiliser ma manipulation ce message s'affiche :

Erreur de compilation :
Membre de méthode ou de données introuvable

voici mon code :

Sub userform_initialize()
ProgramList.Clear

Dim myCell As Range
Dim rngItems As Range

' Get the row where to paste program to get the number of programs
ProgramRow = Sheets("Saved Programs").Range("B" & Rows.Count).End(xlUp).Row + 1

If Sheets("Saved Programs").Range("A1") = "" Then ProgramRow = 1

Set rngItems = Sheets("Saved Programs").Range("A1:A" & ProgramRow)

With Me.ProgramList

For Each myCell In rngItems.Cells
If Trim(myCell) <> "" Then
.AddItem myCell.Value
End If
Next myCell
End With

End Sub

Bien cordialement

2 réponses

  • Votes
  • Date
  • Date décroissante
  1. Bonjour
    as tu essayé sans le with?

    For Each myCell In rngItems.Cells 
        If Trim(myCell) <> "" Then ProgramList.AddItem myCell.Value 
    Next myCell 
    1. Contributeur
      Bonjour,

      merci d'utiliser la balise Code (icône <>) pour qu'il reste indenté et plus lisible.
      Préciser la ligne en erreur.
      eric