Sub ImportImage()
repertoire = ThisWorkbook.Path & "\"
[B2].Select
Set monimage = ActiveSheet.Pictures.Insert(repertoire & [A2] & ".jpg")
monimage.Height = ActiveCell.Height
monimage.Width = ActiveCell.Width
End Sub
Sub Macro1()
Range("C3").Select
ActiveSheet.Pictures.Insert("C:\TonRepertoire\TonSousRepertoire\....\...\TonImage.jpg").Select
End Sub
Sub Macro1()
Dim MonImage As String
MonImage = Range("A1").Value
Range("C3").Select
ActiveSheet.Pictures.Insert("C:\TonRepertoire\TonSousRepertoire\....\...\" & MonImage & ".jpg").Select
End Sub
ou bien pour afficher un message quand même :Sub Macro1()
Dim MonImage As String
MonImage = Range("A1").Value
Range("C3").Select
On Error Resume next
ActiveSheet.Pictures.Insert("C:\TonRepertoire\TonSousRepertoire\....\...\" & MonImage & ".jpg").Select
End Sub
CordialementSub Macro1()
Dim MonImage As String
MonImage = Range("A1").Value
Range("C3").Select
On Error GoTo MessErreur
ActiveSheet.Pictures.Insert("C:\TonRepertoire\TonSousRepertoire\....\...\" & MonImage & ".jpg").Select
Exit Sub
MessErreur:
MsgBox ("L'image " & MonImage & " n'existe pas")
End Sub