Sub Images()
Dim ps$, h As Hyperlink, had$, p%, ext$, c As Range, cad$, s As Shape
ps = Application.PathSeparator
Application.ScreenUpdating = False
With Sheets("Feuil1")
.Visible = xlSheetVisible
For Each h In .Hyperlinks
had = h.Address
p = InStrRev(had, ".")
If p Then
ext = Mid(had, p)
If ext = ".jpg" Or ext = ".jpeg" Or ext = ".png" Or ext = ".gif" Or ext = ".tiff" Then
If Not had Like "?:" & ps & "*" Then had = ThisWorkbook.Path & ps & had
Set c = h.Parent.Offset(, 1)
cad = c.Address
For Each s In .Shapes
If s.TopLeftCell.Address = cad Then s.Delete
Next s
With .Pictures.Insert(had)
.ShapeRange.LockAspectRatio = msoTrue
.Height = c.Height - 2
If .Width > c.Width Then .Width = c.Width - 2
.Top = c.Top + (c.Height - .Height) / 2
.Left = c.Left + (c.Width - .Width) / 2
End With
End If
End If
Next h
End With
End Sub