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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
| Sub ReCherche_Ecritures()
Dim DéBit, CréDit, SolDE As String,avancement as long
DéBit = 0
CréDit = 0
SolDE = 0
GL.ProB1 = 0
LabPRB.Width = 0 ' label de progressbar
GL.ProB1.Visible = True
GL.Image1.Visible = True
Dim NbLgne As Variant
Dim i, j, Y As Integer
Dim K, P
Dim TesteR, Teste2 As Boolean
Dim U As Byte
GL.ListBox1.Clear
avancement=nbligne/200
NbLgne = Sheets("Récap ").Range("a65000").End(xlUp).Row
'Sheets("feuil2").Range("b27") = NbLgne
For i = 2 To NbLgne + 1
'si la sub se trouve dans le userform
LabPRB.Width = ((i-1)/avancement*)'tout simplement
'si la sub ne se trouve pas dans le userform
' on regarde pour les analyt
TesteR = False
If GL.ToUs = True Then
TesteR = True
GoTo fin1
End If
For Y = 0 To GL.ListBox3.ListCount - 1
If Val(GL.ComptAnal.Value) = 0 And GL.TousAnal.Caption = "Sans analyt." And GL.ToUs = False Then
If Cells(i, 5) = "" Then TesteR = True Exit For
End If
If Val(GL.ComptAnal.Value) > 0 Then
If GL.ListBox3.Selected(Y) = False Then TesteR = False
If GL.ListBox3.Selected(Y) = True And Cells(i, 5) Like GL.ListBox3.List(Y) Then
TesteR = True
Exit For
End If
End If
Next Y
fin1:
If Val(GL.comp.Value) > 0 Then
For j = 0 To GL.ListBox2.ListCount - 1
Teste2 = False
If Cells(i, 9) = GL.ListBox2.List(j) Then
Teste2 = True
Exit For
End If
Next j
End If
If Val(GL.comp.Value) = 0 Then
Teste2 = False
If Cells(i, 9) = GL.ComboBox6.Value Then Teste2 = True
End If
If GL.ComboBox6.Text = "" Then Teste2 = True
If Cells(i, 10) <> "" And Cells(i, 10) <> 0 And TesteR = True And Teste2 = True _
And Cells(i, 9) Like UCase(GL.Tst1.Text) & "*" _
And Cells(i, 1) Like UCase(GL.Tst3.Text) & "*" _
And Cells(i, 12) Like UCase(GL.Tst4.Text) & "*" _
And Cells(i, 6) Like "*" & UCase(GL.Tst2.Text) & "*" Then
GL.ListBox1.AddItem
GL.ListBox1.List(K, 0) = Sheets("Récap ").Cells(i, 2)
GL.ListBox1.List(K, 1) = "| " & Sheets("Récap ").Cells(i, 3)
GL.ListBox1.List(K, 2) = "| " & Sheets("Récap ").Cells(i, 5)
GL.ListBox1.List(K, 3) = "| " & Sheets("Récap ").Cells(i, 6)
GL.ListBox1.List(K, 4) = "| " & Sheets("Récap ").Cells(i, 7)
GL.ListBox1.List(K, 5) = "| " & Sheets("Récap ").Cells(i, 9)
GL.ListBox1.List(K, 6) = "| " & Sheets("Récap ").Cells(i, 8)
GL.ListBox1.List(K, 7) = "| " & Sheets("Récap ").Cells(i, 30)
DéBit = DéBit + Sheets("Récap ").Cells(i, 30)
GL.ListBox1.List(K, 8) = "| " & Sheets("Récap ").Cells(i, 29)
CréDit = CréDit + Sheets("Récap ").Cells(i, 29)
GL.ListBox1.List(K, 9) = "| " & Sheets("Récap ").Cells(i, 4)
K = K + 1
'Sheets("feuil2").Range("c27") = i
End If
GL.ComptLigne = K
Next i
GL.TdéBit.Value = DéBit
GL.TdéBit.Value = Format(GL.TCit.Value, "#,##0.00")
GL.TcréDit.Value = CréDit
GL.TcréDit.Value = Format(GL.TDit.Value, "#,##0.00")
GL.TSolDe.Value = CréDit - DéBit
GL.TSolDe.Value = Format(GL.TlDe.Value, "#,##0.00")
GL.ProB1.Visible = False
GL.Image1.Visible = False
GL.ListBox1.ColumnWidths = "50;55;60;110;170;150;30;55;55;80"
End Sub |
Partager