Public Test, Mot
Sub NbTotOccurences()
Dim T, i%
T = Range("B2:F" & [A50000].End(xlUp).Row)
Test = [L2:P2]
For i = 1 To UBound(T)
Mot = "-" & T(i, 1) & "-" & T(i, 2) & "-" & T(i, 3) & "-" & T(i, 4) & "-" & T(i, 5) & "-"
Cells(i + 1, "H") = ChercheMot(Mot)
Next i
End Sub
Function ChercheMot(Mot)
Dim j%, k%
For j = 1 To 4
For k = j + 1 To 5
If Mot Like "*-" & Test(1, j) & "-*" And Mot Like "*-" & Test(1, k) & "-*" Then ChercheMot = ChercheMot + 1
Next k
Next j
End Function
Evidemment les macros font appel à Feuil2 que vous avez supprimé.Car la le tri sur occurrences et tri sur lignes font bugger la macro mais je pense que c'est tout à fait normal
Public Test, Mot
Sub NbTotOccurences()
Dim T, i%
[H2:H10000].ClearContents
T = Range("B2:F" & [A50000].End(xlUp).Row)
DL = [L50000].End(xlUp).Row
For Ligne = 1 To DL
Test = Range(Cells(Ligne, "L"), Cells(Ligne, "P"))
For i = 1 To UBound(T)
Mot = "-" & T(i, 1) & "-" & T(i, 2) & "-" & T(i, 3) & "-" & T(i, 4) & "-" & T(i, 5) & "-"
Cells(i + 1, "H") = Cells(i + 1, "H") + ChercheMot(Mot)
Next i
Application.StatusBar = "Progression : " & Format(Ligne / DL, "0%")
Next Ligne
Application.StatusBar = ""
End Sub
Function ChercheMot(Mot)
Dim j%, k%
For j = 1 To 4
For k = j + 1 To 5
If Mot Like "*-" & Test(1, j) & "-*" And Mot Like "*-" & Test(1, k) & "-*" Then ChercheMot = ChercheMot + 1
Next k
Next j
End Function
Car la le tri sur occurrences et tri sur lignes font bugger la macro
Bonjour,Désolé pour la feuille 2 je ne savais pas qu'elle contenait des informations,