Private Sub Cmd_Recherche_Click()
Dim c As Range
Dim colonne As Byte
Dim ligne As Integer
Dim x As Integer
Dim i As Byte
'****************************
Me.Label_NbCltsArchives.Visible = False
Me.Label_NbCltsTrouves.Visible = True
Me.TextBox_NbCltsArchives.Visible = False
With Me.ListView_Archives
With .ColumnHeaders
.Clear
.Add , , "N° du Client", 70
.Add , , "N° Ent.", 50, lvwColumnLeft
.Add , , "N° SIREN", 70, lvwColumnCenter
.Add , , "Nom du Client", 200, lvwColumnLeft
End With
.CheckBoxes = True
.FullRowSelect = True
.Gridlines = True
.ListItems.Clear
.View = lvwReport
End With
colonne = IIf(ComboBox1.ListIndex = 0, 3, 1)
With Feuil2 'salut zon :)
ligne = .Cells(65536, colonne).End(xlUp).Row
For Each c In .Range(.Cells(2, colonne), .Cells(ligne, colonne))
If c = CDbl(TextBox_No) Then
x = x + 1
Me.ListView_Archives.ListItems.Add , , .Cells(c.Row, 1)
For i = 2 To 4
Me.ListView_Archives.ListItems(x).ListSubItems.Add , , .Cells(c.Row, i)
Next i
End If
Next c
End With
With Me.TextBox_NbCltsTrouves
.Visible = True
Me.TextBox_NbCltsTrouves = ListView_Archives.ListItems.Count - 0
Me.TextBox_NbCltsTrouves = Format(Me.TextBox_NbCltsTrouves, "### ##0")
End With
End Sub