Private Sub UserForm_Initialize()
ImporterDonneesCSV
With LsV_Import
With .ColumnHeaders
.Clear
.Add , , "N° Question", 60
.Add , , "Question", 300
.Add , , "Réponse A", 100
.Add , , "Réponse B", 100
.Add , , "Réponse C", 100
.Add , , "Réponse D", 100
.Add , , "Niveau", 40, lvwColumnCenter
End With
.View = lvwReport 'Affichage en mode Rapport
End With
LsV_Import.Gridlines = True 'Affichage d'un quadrillage
appel
fin:
Dim i As Integer
' Parcours de toutes les lignes de la ListView
For i = 1 To LsV_Import.ListItems.Count
' Changer la couleur de la deuxième colonne (index 2)
'LsV_Import.ListItems(i).ListSubItems(3).ForeColor = RGB(146, 208, 80) ' Modifier vbRed avec la couleur souhaitée
Next i
End Sub
Sub appel()
Dim i, k
With LsV_Import
Sheets("Import Theme").Activate
For i = 1 To Range("A65536").End(xlUp).Row
.ListItems.Add , , Cells(i, 1)
For k = 2 To 11
.ListItems(.ListItems.Count).ListSubItems.Add , , Cells(i, k), , lvwColumnCenter
Next
.ListItems(.ListItems.Count).ListSubItems.Add , , i, , lvwColumnCenter
Next
End With
fin:
End Sub