1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Sub Macro1()
Dim cpt_l As Integer
Dim repDefaut As String, outil As String, nomoutil As String, cheminPdfComplet As String
repDefaut = "C:\leelya\vérification\"
For cpt_l = 2 To Sheets("Feuil1").Range("a" & Rows.Count).End(xlUp).Row
outil = Sheets("Feuil1").Cells(cpt_l, 1) 'COLONNE A
nomoutil = Sheets("Feuil1").Cells(cpt_l, 2) 'COLONNE B
cheminPdfComplet = repDefaut & outil & "\" & nomoutil & ".pdf"
Sheets("Feuil1").Cells(cpt_l, 2).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=cheminPdfComplet, _
TextToDisplay:=nomoutil
Next cpt_l
End Sub |