Bonjour à toutes et à tous.
Voila j'ai un gros souci que je n'arrive pas à résoudre encore une fois.
J'ai une interface qui fonctionne très bien (filtrage, userform, etc....)
Mais voila j'aimerais que mes combobox ignorent les cellules vides dans chaque colonnes sélectionnées.
Je vous joins un exemple qui vous permettra de bien situé ma demande ainsi que le code de mon userform.
Merci beaucoup
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Option Base 1 Private Sub UserForm_Initialize() Dim LastLig As Long Dim j As Long Dim i As Byte Dim n As Long Dim ColCrit Dim hWnd As Long ColCrit = Array(1, 2, 3, 4, 5, 6) With Sheets("exemple") .AutoFilterMode = False For i = 1 To UBound(ColCrit) LastLig = .Cells(.Rows.Count, ColCrit(i)).End(xlUp).Row For j = 3 To LastLig Me.Controls("ComboBox" & i).Value = .Cells(j, ColCrit(i)).Value If Me.Controls("ComboBox" & i).ListIndex = -1 Then Me.Controls("ComboBox" & i).AddItem .Cells(j, ColCrit(i)).Value Me.Controls("ComboBox" & i).ListIndex = -1 Next j With Me.Controls("ComboBox" & i) For x = 0 To .ListCount - 1 For y = 0 To .ListCount - 1 If .List(x) < .List(y) Then strTemp = .List(x) .List(x) = .List(y) .List(y) = strTemp End If Next y Next x End With Next i End With
Partager