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
| Private Sub UserForm_Initialize()
Dim c, t, u, a As Variant, m As Object, n As Object, s As Object, g As Object
Sheets("liste_du_personnel").Select
Set m = CreateObject("Scripting.Dictionary")
Set n = CreateObject("Scripting.Dictionary")
Set s = CreateObject("Scripting.Dictionary")
Set g = CreateObject("Scripting.Dictionary")
For Each c In Range("e7:e" & Range("e65536").End(xlUp).Row)
If Not m.Exists(c.Value) And c <> "" Then m.Add c.Value, c.Value
Next c
ComboBox1.List = m.items
For Each t In Range("f7:f" & Range("f65536").End(xlUp).Row)
If Not n.Exists(t.Value) And t <> "" Then n.Add t.Value, t.Value
Next t
ComboBox2.List = n.items
For Each u In Range("u7:u" & Range("u65536").End(xlUp).Row)
If Not s.Exists(u.Value) And u <> "" Then s.Add u.Value, u.Value
Next u
ComboBox3.List = s.items
For Each a In Range("v7:v" & Range("v65536").End(xlUp).Row)
If Not g.Exists(a.Value) And a <> "" Then g.Add a.Value, a.Value
Next a
ComboBox4.List = g.items
Me.Width = Application.Width - 3
Me.Height = Application.Height - 3
End Sub |
Partager