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
| Private Sub UserForm_Initialize()
Dim derlig As Long
TextBox15 = Date
Sheets("BDA").Activate
Feuil1.Visible = xlSheetVisible
Set f = Sheets("BDA")
derlig = f.Cells(Rows.Count, 1).End(xlUp).Row
Me.ComboBox3.List = Array("Tom", "Mani", "Ramv")
If derlig >= 3 Then
bv = f.Range("a3:f" & derlig).Value
Else
bv = f.Range("a3:f3").Value
End If
For i = 1 To UBound(bv, 2) - 1
temp = temp & f.Columns(i).Width * 0.62 & ";"
Me("label" & i) = f.Cells(2, i)
Me("label" & i + 19) = f.Cells(2, i)
Me("label" & i).Top = Me.ListBox1.Top - 15
Largeur = Largeur + f.Columns(i).Width * 1
Next
Me.ListBox1.ColumnWidths = temp: Me.Width = Largeur - 128
Me.ListBox1.List = bv
'--
Set d1 = CreateObject("scripting.dictionary")
For i = 1 To UBound(bv)
If bv(i, 3) <> "" Then d1(bv(i, 3)) = ""
Next i
Cbx1 = d1.Keys
Call tri(Cbx1, LBound(Cbx1), UBound(Cbx1))
Me.ComboBox1.List = Cbx1
Me.ComboBox1.SetFocus
'--
Set d1 = CreateObject("scripting.dictionary")
For i = 1 To UBound(bv)
If bv(i, 2) <> "" Then d1(bv(i, 2)) = CDate(bv(i, 2))
Next i
Cbx2 = d1.items
Call tri(Cbx2, LBound(Cbx2), UBound(Cbx2))
Me.ComboBox2.List = Cbx2
End Sub |
Partager