Private Sub Worksheet_Calculate()
[G1] = "" 'RAZ
With ThisWorkbook.SlicerCaches("Segment_Légume")
If Not .SlicerItems("Chou").Selected Then
[G1].Hyperlinks.Add [G1], ThisWorkbook.Path & "\Carotte.xlsx", TextToDisplay:="Carotte.xlsx"
ElseIf Not .SlicerItems("Carotte").Selected Then
[G1].Hyperlinks.Add [G1], ThisWorkbook.Path & "\Chou.xlsx", TextToDisplay:="Chou.xlsx"
End If
End With
End Sub
Private Sub Worksheet_Calculate()
Dim si As SlicerItem, nom$, n%
For Each si In ThisWorkbook.SlicerCaches(1).SlicerItems
If si.Selected Then nom = si.Name & ".xlsx": n = n + 1
Next
[G1] = "" 'RAZ
If n = 1 Then [G1].Hyperlinks.Add [G1], ThisWorkbook.Path & "\" & nom, TextToDisplay:=nom
End Sub