Creer des liens hypertexte avec un UserForm
Bonjour à toutes et à tous
Description: à partir d' un UserForm j'alimente en liens Hypertexte 3 colonnes
ceci sont placés sur la première ligne libre
Pouvez vous m'aider à modifier ce code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Option Explicit
Private Sub CommandButton1_Click() 'Nouvelle Fiche
LigneCourante = Range("A65000").End(xlUp).Row + 1
InitUSF1
UserForm1.Show
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'Consultation de fiche
Dim Derligne As Integer
Dim i As Byte
Derligne = Range("A65000").End(xlUp).Row
If Derligne > 1 And Not Intersect(Target, Range("A2:E" & Derligne)) Is Nothing Then
InitUSF1
LigneCourante = Target.Row
For i = 1 To 3
If Cells(LigneCourante, i + ColonneLien).Value <> "" Then
ExisteDoc(i) = True
Doc(i) = Cells(LigneCourante, i + ColonneLien).Hyperlinks.Item(1).Address
With UserForm1.Controls("LHT" & i)
.Font.Bold = True
.ForeColor = &HFF0000
.Caption = " " & Cells(LigneCourante, i + ColonneLien).Value
End With
End If
Next i
UserForm1.Show
Cancel = True
End If
End Sub
Private Sub InitUSF1()
Dim i As Byte
For i = 1 To 3
With UserForm1.Controls("LHT" & i)
.Font.Bold = False
.ForeColor = &H80000012
.Caption = " Document lié n°" & i
End With
ExisteDoc(i) = False
Next i
End Sub |
Pour que : les liens créés soit envoyés vers la feuil2 au lieu de la feuil1
Cordialement J-C