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
| Option Explicit
Public Lg As Long, i As Integer, C As Variant, Lst As ListItem
Sub Tbl_Accueil()
With Sheets("feuil1")
C = .Range("A1:H" & .Range("A65000").End(xlUp).Row).Value
End With
End Sub
Sub affiche_listV()
Tbl_Accueil
With UserForm1.ListView1
.ListItems.Clear
With .ColumnHeaders
.Clear
.Add , , "code", 30
.Add , , "nom", 120
.Add , , "profession", 80
.Add , , "naissance", 80
.Add , , "contacts", 80
.Add , , "nationalite", 80
.Add , , "village", 80
.Add , , "formation", 80
End With
.Gridlines = True
.BorderStyle = ccFixedSingle
.FullRowSelect = True
.View = lvwReport
For Lg = 2 To UBound(C)
Set Lst = .ListItems.Add(, , C(Lg, 1))
With Lst
.ListSubItems.Add , , C(Lg, 2)
For i = 3 To 8
.ListSubItems.Add , , C(Lg, i)
Next i
C(Lg, 4) = Format(C(Lg, 4), "dd/mm/yyyy")
End With
Next Lg
End With
End Sub
Sub affiche_usf()
UserForm1.Show
End Sub |