[SIZE="1"]Sub essais()
Dim tab_etat 'Crée une variable
Set tab_etat = CreateObject("Scripting.Dictionary")
Range(Cells(2, 2), Cells(4, 6)).ClearContents
nom = "lili"
Sheets(nom).Select
ligne = 2
While Cells(ligne, [COLOR="red"]2[/COLOR]) <> ""
cle = nom & "_" & Cells(ligne, [COLOR="red"]2[/COLOR])
If IsEmpty(tab_etat(cle)) Then
tab_etat(cle) = 1
Else
tab_etat(cle) = tab_etat(cle) + 1
End If
ligne = ligne + 1
Wend
nom = "lolo"
Sheets(nom).Select
ligne = 2
While Cells(ligne, [COLOR="red"]2[/COLOR]) <> ""
cle = nom & "_" & Cells(ligne, [COLOR="red"]2[/COLOR])
If IsEmpty(tab_etat(cle)) Then
tab_etat(cle) = 1
Else
tab_etat(cle) = tab_etat(cle) + 1
End If
ligne = ligne + 1
Wend
nom = "lulu"
Sheets(nom).Select
ligne = 2
While Cells(ligne, [COLOR="red"]2[/COLOR]) <> ""
cle = nom & "_" & Cells(ligne, [COLOR="red"]2[/COLOR])
If IsEmpty(tab_etat(cle)) Then
tab_etat(cle) = 1
Else
tab_etat(cle) = tab_etat(cle) + 1
End If
ligne = ligne + 1
Wend
Sheets("Feuil1").Select
For Each tmp1 In tab_etat
cle = tmp1
pos = InStr(cle, "_")
etat = Mid(cle, pos + 1)
ope = Mid(cle, 1, pos - 1)
Select Case ope
Case "lili": ligne = 2
Case "lolo": ligne = 3
Case "lulu": ligne = 4
End Select
Select Case etat
Case "début": colonne = 2
Case "en cours": colonne = 3
Case "fin": colonne = 4
Case "rejeté": colonne = 5
End Select
Cells(ligne, colonne) = tab_etat(cle)
Next
End Sub[/SIZE]