Salut Akhlan
Salut Jean-Eric,
un double-clic sur la feuille démarre la macro avec affichage en [C1].
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim tTab, tSplit, tRep, iNb%, iRep%, sRep$, sScan$
Cancel = True
'
tTab = Range("A1").Resize(Range("A" & Rows.Count).End(xlUp).Row, 1).Value
For x = 1 To UBound(tTab, 1)
If tTab(x, 1) <> "" Then
tSplit = Split(tTab(x, 1), "-")
For y = 0 To UBound(tSplit)
If InStr(sScan, tSplit(y)) = 0 Then
iRep = 1
sScan = sScan & IIf(sScan = "", tSplit(y), "-" & tSplit(y))
For Z = x + 1 To UBound(tTab, 1)
If tTab(Z, 1) <> "" Then
If x = 1 And y = 0 Then iNb = iNb + 1
If InStr(tTab(Z, 1), tSplit(y)) > 0 Then iRep = iRep + 1
End If
Next
End If
If x = 1 And y = 0 Then iNb = iNb + 1
If iRep = iNb Then sRep = sRep & IIf(sRep = "", tSplit(y), "-" & tSplit(y))
Next
Exit For
End If
Next
[C1] = sRep
'
End Sub
Pour appliquer à l'ensemble des feuilles, il faudrait savoir si :
- TOUTES les feuilles doivent être traitées, sans exception ;
- si non, comment reconnaître les feuilles à traiter (particularité dans leur nom ?) ;
- à quel emplacement exact faut-il afficher le résultat.
A+