1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim fichier As String
Dim Sh As Shape
If ActiveCell.Column < 2 Or ActiveCell.Column > 2 Then Exit Sub
' Efface l'ancienne image
For Each Sh In Worksheets("Presentation").Shapes
If Sh.Type = msoPicture Then Sh.Delete
Next
' Variables pour les chemins des dossiers
fichier = Sheets("Resultat").Range("A6").Value & ".jpg"
chemin = "T:\...\Photos\"
' Insertion de l'image
Range("E5").Select
ActiveSheet.Pictures.Insert(chemin & fichier).Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 300
End Sub |