Bon bah comme d'autres j'ai cette foutu erreur ....
un copier coller d'un code que je comprends pas trop surement
Donc une fois de plus, please H E L P
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
37
38
39
40
41
42 Private Sub UserForm_Initialize() AN.Value = Year(Now) MOIS.Value = MonthName(Month(Now)) '''''''''''''''Récupération des donnés Projets Worksheets("PROJETS").Select nblignes = Worksheets("PROJETS").Range("E65536").End(xlUp).Row Dim j As Integer 'Supprime les anciennes donnêes A1CB1.Clear 'Boucle sur les lignes de la colonne A (a partir de la 2eme ligne jusqu'a nblignes) For j = 2 To nblignes A1CB1 = Range("A" & j) 'Remplit le ComboBox sans doublons If A1CB1.ListIndex = -1 And A1CB1.Value <> "" Then A1CB1.AddItem Worksheets("PROJETS").Range("A" & j) Next j Trier1 'Enl_ve la sêlection dans le ComboBox A1CB1.ListIndex = -1 End Sub Private Sub Trier1() indexA1CB1 = A1CB1.ListIndex choixA1CB1 = A1CB1.List(indexA1CB1) ' C'est là que ça plante test = A1CB1.ListCount - 1 selec = A1CB1.List(0) Dim x As Long For x = 0 To A1CB1.ListCount - 1 For y = 0 To test If A1CB1.List(x) < A1CB1.List(y) Then temp = A1CB1.List(y) A1CB1.List(y) = A1CB1.List(x) A1CB1.List(x) = temp End If Next y Next x End Sub
Partager