Membre de méthode ou de données introuvable

Résolu
sofyen31 Messages postés 80 Statut Membre -  
eriiic Messages postés 25847 Statut Contributeur -
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

fabien25000 Messages postés 697 Statut Membre 59
 
Bonjour
as tu essayé sans le with?

For Each myCell In rngItems.Cells 
    If Trim(myCell) <> "" Then ProgramList.AddItem myCell.Value 
Next myCell 
0
eriiic Messages postés 25847 Statut Contributeur 7 279
 
Bonjour,

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