Hello Stack Overflow community,
I would like to modify this code so instead of inserting the image of a folder into excel given a condition, it should copy just the path link (as an hyperlink) and paste it to cell (instead of a picture like it's being done now) from its source folder. This would be solely to make the file lesser.
Herwith the actual code:
Sub InserImage()
Dim ficimg As Variant
Dim derlig As Long
Dim i As Integer
Dim Ma_forme As Shape
Dim Maplage As Range
derlig = Range("A" & Rows.Count).End(xlUp).Row
'derlig = 10
For i = 2 To derlig
For Each Maplage In ActiveSheet.Range("B" & i)
If Ma_forme Is Nothing Then
On Error Resume Next
ficimg = "S:\Transversal projects\SAP Data\Articles\" & Range("A" & i) & "\" & Range("A" & i) & ".jpg"
nom = Range("A" & i).Value
With ActiveSheet
.Shapes.AddPicture ficimg, True, True, Left:=Range("B" & i).Left, Top:=Range("B" & i).Top, Height:=Range("B" & i).Height, Width:=Range("B" & i).Width
End With
End If
Next Maplage
Next i
End Sub
Aucun commentaire:
Enregistrer un commentaire