1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Dim MaCell As Range, Tableau As Variant, FeuilleCible As Worksheet
Dim cmptLig As Long, cmptCol As Long, NbLigne As Long
Set FeuilleCible = ThisWorkbook.Worksheets("Sheet2")
Tableau = ThisWorkbook.Worksheets("Sheet1").UsedRange.Value
For Each MaCell In FeuilleCible.Range(FeuilleCible.Cells(3, 1), FeuilleCible.Cells(3, 1).End(xlDown))
If MaCell.Value = 214 Then Debug.Print "toto"
For cmptLig = 1 To UBound(Tableau, 1)
For cmptCol = 1 To UBound(Tableau, 2)
If InStr(1, CStr(Tableau(cmptLig, cmptCol)), CStr(MaCell.Value)) > 0 Then
NbLigne = NbLigne + 1
Exit For
End If
Next cmptCol
Next cmptLig
MaCell.Offset(, 2).Value = NbLigne
NbLigne = 0
Next MaCell |
Partager