Private Sub CommandButton1_Click()
Dim dico, T, i&, j&
Dim F(), chemin, fichier, cat
Set dico = CreateObject("scripting.dictionary")
dico.CompareMode = TextCompare
T = Worksheets("Feuil1").Range("a1").CurrentRegion
For i = 2 To UBound(T)
For j = 1 To 5 Step 2
If T(i, j) <> "" Then dico(T(i, j)) = 0
Next j
Next i
chemin = ThisWorkbook.Path & "\RESEAUX\EN COURS\"
chemin = Replace(chemin, "\\", "\")
fichier = Dir(chemin & "*.txt")
Do Until fichier = ""
fichier = Left(fichier, Len(fichier) - 4)
For Each cat In dico.Keys
If fichier Like cat & "#" & "*" Then dico(cat) = dico(cat) + 1
Next cat
fichier = Dir
Loop
For i = 2 To UBound(T)
For j = 1 To 5 Step 2
If T(i, j) <> "" Then T(i, j + 1) = dico(T(i, j))
Next j
Next i
Worksheets("Feuil1").Range("a1").CurrentRegion = T
End Sub