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
| dercol = ActiveSheet.UsedRange.Columns.Count
If dercol > 17 Then dercol = 17
derligne = Range("A65536").End(xlUp).Row
'-------------------------------------------------------------------------
'--------------test les checkbox ----------------------------------------------
If Rech <> "" Then
For i = 1 To dercol
If Me.Controls("Cr" & i).Value = True Then
If dercol > 9 Then dercol = 9
ListBox1.ColumnCount = 9
ListBox1.ColumnWidths = "70;20;100;100;100;100;100;100;100"
a = 0
For ligne = 2 To derligne
If Cells(ligne, i) Like "*" & Rech & "*" Then
ListBox1.AddItem Cells(ligne, 1)
' ---alimenter le tableau Tbllist -----------------------
Tbllist(ii) = ligne
ii = ii + 1
For z = 2 To dercol
Select Case Cells(2, z).Value
Case Is = "long"
ListBox1.List(a, z) = Cells(ligne, z)
Case Is = "auto"
ListBox1.List(a, z) = Cells(ligne, z)
Case Is = "liste"
ListBox1.List(a, z) = Cells(ligne, z)
Case Is = ""
ListBox1.List(a, z) = Cells(ligne, z)
Case Is = "noir"
ListBox1.List(a, z) = Cells(ligne, z)
Case Is = "tél"
ListBox1.List(a, z) = Format(Cells(ligne, z), "00 00 00 00 00")
Case Is = "postale"
ListBox1.List(a, z) = Format(Cells(ligne, z), "00 000")
Case IsDate(Cells(2, z))
ListBox1.List(a, z) = Cells(ligne, z)
End Select
If Cells(2, z).HasFormula = True Then ListBox1.List(a, z) = Cells(ligne, z)
Next z
a = a + 1
End If
Next ligne
End If
Next i |
Partager