XL 2016 Erreur d’exécution 35600

PORCHER

XLDnaute Occasionnel
Private Sub ListView1_Enter()
Application.ScreenUpdating = False
Dim C As Integer, n As Integer
Dim NoLgn As Long

ThisWorkbook.Sheets("Formation").Activate
With Me
With .ListView1
.View = 3
.CheckBoxes = True
.Gridlines = True
.FullRowSelect = True
.HideColumnHeaders = False
.LabelEdit = 1
With .ColumnHeaders
.Clear
.Add , , "Id", 30, lvwColumnLeft
.Add , , "Nom", 90
.Add , , "Prénom", 50
.Add , , "Mieux connaitre les Restos", 75, lvwColumnCenter
.Add , , "Aide à la personne", 75, lvwColumnCenter
.Add , , "Initiation inscription", 75, lvwColumnCenter
.Add , , "Distrib. Accomp.", 75, lvwColumnCenter
.Add , , "Navision", 75, lvwColumnCenter
End With

NoLgn = Worksheets("Formation").Range("A65536").End(xlUp).Row
For C = 2 To NoLgn
' Remplir la première colonne
ListView1.ListItems.Add , , Cells(C, 1) ' Id
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 2) ' Nom
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 3) ' Prénom
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 5) ' Mieux connaitre les restos
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 6) ' Aide à la personne
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 7) ' Initiation
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 8) 'Distribution Accomp.
ListView1.ListItems(n + 1).ListSubItems.Add , , Cells(C, 9) ' Navison

n = n + 1
Next C
End With
End With
End Sub
Private Sub MiseAJourTB()
Dim k As Byte
TextBox1 = ListView1.ListItems(ListView1.SelectedItem.index).Text
For k = 1 To 8
' Controls("TextBox" & K + 1) = ListView1.ListItems(ListView1.SelectedItem.index).ListSubItems(K)
Next
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Me.Tb_Id = ListView1.ListItems(Item.index).Text
Me.Tb_Nom = ListView1.ListItems(Item.index).ListSubItems(2).Text
Me.TextBox1 = ListView1.ListItems(Item.index).ListSubItems(5).Text
Me.TextBox2 = ListView1.ListItems(Item.index).ListSubItems(6).Text
Me.TextBox3 = ListView1.ListItems(Item.index).ListSubItems(7).Text
Me.Tb_Distrib = ListView1.ListItems(Item.index).ListSubItems(8).Text ICI > (Erreur d'execution 35600, index out of bounds) ???
Me.TextBox5 = ListView1.ListItems(Item.index).ListSubItems(9).Text
MiseAJourTB
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
315 134
Messages
2 116 612
Membres
112 811
dernier inscrit
shade1452