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
| Private Sub UserForm_Activate()
Me.DTPicker1.Value = Now
MSFlexGrid1.ColWidth(0) = 1700
MSFlexGrid1.ColWidth(1) = 1000
MSFlexGrid1.TextMatrix(0, 1) = "TYPE"
MSFlexGrid1.ColWidth(2) = 1500
MSFlexGrid1.TextMatrix(0, 2) = "Numéro"
MSFlexGrid1.ColWidth(3) = 1000
MSFlexGrid1.TextMatrix(0, 3) = "Indice"
MSFlexGrid1.ColWidth(4) = 3000
MSFlexGrid1.TextMatrix(0, 4) = "Mise à jour par "
Sheets("Feuil3").Select
if Cells(1, 8).Value=0 then exit sub 'pour la 1ére initialisation
UsFrm.MSFlexGrid1.Rows = Cells(1, 8).Value
For Ligne = 1 To UsFrm.MSFlexGrid1.Rows - 1
For Colonne = 0 To UsFrm.MSFlexGrid1.Cols - 1
UsFrm.MSFlexGrid1.TextMatrix(Ligne, Colonne) = Cells(Ligne, Colonne + 1).Value
'Debug.Print UsFrm.MSFlexGrid1.TextMatrix(Ligne, Colonne)
'Debug.Print Cells(Ligne + 1, Colonne + 1).Value
Next Colonne
Next Ligne
End Sub |