XL 2019 Créer un lien hypertexte par VBA

CiolBel

XLDnaute Nouveau
Bonjour à tous, je modifie mon précédent post car il était très peu clair.

Je cherche à compléter la macro suivante en (Iw, 1) pour générer un lien hypertexte style "Cliquez ici" vers la feuille en cours de traitement mais je ne sais pas où commencer. Des idées?

Sub Synthèse()
Dim Sh As Worksheet
Range("B2:L1000").ClearContents
Iw = 2 ' Index écriture
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name = "Synthèse" Then GoTo EndConsolidation
Cells(Iw, 1) = ?????
Cells(Iw, 2) = Sh.Name
If Sh.Range("D8") = "" Then
Cells(Iw, 3) = "-"
Else
Cells(Iw, 3) = Sh.Range("D8")
End If

Iw = Iw + 1
EndConsolidation:
Next Sh

End Sub
 
Dernière édition:
Solution
Bonjour,
Testez à la place de Cells(Iw, 1) = ????? :
Code:
Cells(Iw, 1).Select
With Selection
    .Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="'" & Sh.Name & "'" & "!" & "A1", TextToDisplay:="Cliquez ici"
End With

Discussions similaires