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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
Sub ACT_AfficheList01_Userform5()
Dim i, j, k, l As Integer
Dim ValeurConcateneA As String
Dim Index_nbrColonne As Integer
Dim Index_nbrLigne As Integer
Dim Nbr_Car As Integer
ValeurConcateneA = ""
CompteurACT_AfficheList01_Userform5 = CompteurACT_AfficheList01_Userform5 + 1
With UserForm5.ListView1
.ListItems.Clear
.Sorted = False
End With
Index_Colonne_BdD = 40
Index_Ligne_ListView1_UserForm5 = 2
i = 1
Do Until IsEmpty(Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, 1))
'Info - ID
UserForm5.ListView1.ListItems.Add , , Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, 1)
'Info - Paramètre spécifié
Index_Colonne_BdD = 40
UserForm5.ListView1.ListItems(i).ListSubItems.Add , , Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, Index_Colonne_BdD)
'Info - Label/Unité/Signe/Valeurs
Index_Colonne_BdD = 48
Index_nbrColonne = Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, 46)
Index_nbrLigne = Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, 47)
For k = 1 To Index_nbrColonne
For l = 1 To Index_nbrLigne
If Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, Index_Colonne_BdD) = "" Then
Else
ValeurConcateneA = ValeurConcateneA & Sheets("TempListView1").Cells(Index_Ligne_ListView1_UserForm5, Index_Colonne_BdD) & "/"
Index_Colonne_BdD = Index_Colonne_BdD + 1
End If
Next l
Nbr_Car = Len(ValeurConcateneA)
Nbr_Car = Nbr_Car - 1
ValeurConcateneA = Left(ValeurConcateneA, Nbr_Car)
If k = Index_nbrColonne Then
'Pas d'action
Else
ValeurConcateneA = ValeurConcateneA & Chr(13)
End If
Next k
UserForm5.ListView1.ListItems(i).ListSubItems.Add , , ValeurConcateneA
'Changement couleur
UserForm5.ListView1.ListItems(i).ForeColor = RGB(0, 0, 255)
For j = 1 To UserForm5.ListView1.ListItems(1).ListSubItems.Count
UserForm5.ListView1.ListItems(i).ListSubItems(j).ForeColor = RGB(0, 0, 255)
Next j
i = i + 1
Index_Ligne_ListView1_UserForm5 = Index_Ligne_ListView1_UserForm5 + 1
ValeurConcateneA = ""
Loop
End Sub |
Partager