Re,
Je n'avais pas encore ouvert le fichier
Pourquoi ne mettez-vous pas les 2 sub dans votre UserForm
Option Explicit
Public Lg As Long, i As Integer, J As Integer, C As Variant, D As Range
Private Sub UserForm_Initialize()
Affiche_col
Remplir_Lvw
End Sub
Sub Affiche_col()
With Me.Listview1
.ListItems.Clear
With .ColumnHeaders
.Clear
.Add , , "N° Conc", 40
.Add , , "Cimetiere", 40
.Add , , "Section", 40
.Add , , "Rang", 40
.Add , , "Code", 40
.Add , , "Occupation", 40
.Add , , "Caveau", 40
.Add , , "Date d'Achat", 40
.Add , , "Duree", 40
.Add , , "Date de fin", 50
.Add , , "Expiré ?", 40
.Add , , "Image", 40
.Add , , "Proprietaire", 90
.Add , , "Domicile", 140
.Add , , "Téléphone", 80
.Add , , "E-Mail", 90
.Add , , "Observation", 140
.Add , , "Nom Defunt", 100
.Add , , "Prénom Defunt", 100
.Add , , "Naissance", 40
.Add , , "Décès", 40
End With
.Gridlines = True
.BorderStyle = ccFixedSingle
.FullRowSelect = True
.View = lvwReport
End With
End Sub
Sub Remplir_Lvw()
Dim C As Variant, Ind As Long
' Définir la plage
With ThisWorkbook.Sheets("source")
C = .Range("A2:U" & Range("U" & Rows.Count).End(xlUp).Row).Value
End With
With Me.Listview1
For Lg = 1 To UBound(C)
.ListItems.Add , , Format(C(Lg, 1), "000")
Ind = .ListItems.Count
For i = 2 To 21
.ListItems(Ind).ListSubItems.Add , , C(Lg, i)
' A quoi ça sert !?
'C(Lg, 15) = Format(C(Lg, 15), "0# ## ## ## ##")
'C(Lg, 8) = Format(C(Lg, 8), "dd/mm/yyyy")
Next i
Next Lg
End With
End Sub
A+