Bonjour toutes et tous,
merci et coucou à Jean Eric
@Toriix
Tu peux mettre directement sur ta feuil1 et sans aucun bouton en reprenant le code de Jean-Eric
Worksheet_Change
Exemple 1:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Const strFOLDER As String = "P:\Maintenance\Purchase orders\Offre de prix\"
Dim i As Long, n As Long
With ActiveSheet
n = .Cells(.Rows.Count, 2).End(xlUp).Row
For i = 2 To n
.Hyperlinks.Add _
anchor:=.Cells(i, 2), _
Address:=strFOLDER & .Cells(i, 2).Text
Next i
End With
End Sub
Exemple 2
Note: il faudrait juste que ta colonne B en présence de virgule soit remplacé par un point ",", "." pour l'extension .pdf
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Const strFOLDER As String = "P:\Maintenance\Purchase orders\Offre de prix\"
Dim i As Long, n As Long
With ActiveSheet
n = .Cells(.Rows.Count, 2).End(xlUp).Row
For i = 2 To n
.Hyperlinks.Add _
anchor:=.Cells(i, 2), _
Address:=strFOLDER & .Cells(i, 2).Text
Columns("B:B").Select ' remplacer , par point
Selection.Replace What:=",", Replacement:=".", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1").Select
Next i
End With
End Sub
ci-joint l'exemple 2
crdlt,
André