XL 2016 lien hypertexte dans un commentaire

Lone-wolf

XLDnaute Barbatruc
Re

Par contre avec une forme ça marche, mais il faut la personnaliser.

VB:
Sub CreeShape()
  Set s = Sheets(1).Shapes.AddShape(msoShapeRectangle, 10, 10, 180, 20)
  s.Name = "Menu1"
  With s
    .TextFrame.Characters.Text = "https://www.excel-downloads.com/"
    .TextFrame.Characters.Font.Color = vbBlue
    .TextFrame.Characters.Font.Underline = xlUnderlineStyleSingle
    .Fill.ForeColor.RGB = vbYellow
    .Line.ForeColor.RGB = vbRed
  End With
  Sheets(1).Hyperlinks.Add Anchor:=s, Address:="https://www.excel-downloads.com/"
End Sub

hyp.gif
 
Dernière édition:

Lone-wolf

XLDnaute Barbatruc
Re

Ici avec 2 formes. Mais tu peux en mettre plus.

VB:
Option Explicit
Public s As Shape

Sub CreeShape()
    Set s = Sheets(1).Shapes.AddShape(msoShapeRectangle, 10, 10, 280, 20)
    s.Name = "Menu1"
    With s
        .TextFrame.Characters.Text = "https://www.excel-downloads.com/forums/forum-excel.7/"
        .TextFrame.Characters.Font.Color = vbBlue
        .TextFrame.Characters.Font.Underline = xlUnderlineStyleSingle
        .Fill.ForeColor.RGB = vbYellow
        .Line.ForeColor.RGB = vbRed
    End With
    Sheets(1).Hyperlinks.Add Anchor:=s, Address:="https://www.excel-downloads.com/forums/forum-excel.7/"

    Set s = Sheets(1).Shapes.AddShape(msoShapeRectangle, 10, 10, 214, 20)
    s.Name = "Menu2"
    With s
        .Top = s.Top + 23
        .TextFrame.Characters.Text = "https://www.excel-downloads.com/forums/"
        .TextFrame.Characters.Font.Color = vbBlue
        .TextFrame.Characters.Font.Underline = xlUnderlineStyleSingle
        .Fill.ForeColor.RGB = vbYellow
        .Line.ForeColor.RGB = vbRed
    End With
    Sheets(1).Hyperlinks.Add Anchor:=s, Address:="https://www.excel-downloads.com/forums/"

End Sub

hyp.gif
 

Discussions similaires

Réponses
5
Affichages
208

Statistiques des forums

Discussions
312 195
Messages
2 086 082
Membres
103 112
dernier inscrit
cuq-laet