Merci de m'accueillir sur le forum.
Je sollicite votre aide, car si j'ai réussi à introduire des photos dans mon tableau, et à les faire apparaitre au bon endroit, je ne parviens pas à effacer la photo n-1 avant d'introduire la photo n.
Merci pour ce que vous allez faire pour moi.
Sub Test()
Dim Val1
Val1 = Sheets("Autorisations de conduite").[E2].Value
Dim val2 As String
val2 = ThisWorkbook.Path & "\Photos\"
Dim val3 As String
val3 = val2 & Val1 & ".jpg"
Range("E2").Select
On Error GoTo erreur
ActiveSheet.Pictures.Insert(val3).Select
Selection.ShapeRange.IncrementLeft 235
Selection.ShapeRange.IncrementTop 100
Selection.ShapeRange.Height = 172.25
Selection.ShapeRange.Width = 173.75
Selection.ShapeRange.ScaleWidth 0.68, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.67, msoFalse, msoScaleFromTopLeft
ActiveSheet.Pictures.Insert(val3).Select
Selection.ShapeRange.IncrementLeft 235
Selection.ShapeRange.IncrementTop 690
Selection.ShapeRange.Height = 172.25
Selection.ShapeRange.Width = 173.75
Selection.ShapeRange.ScaleWidth 0.68, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.67, msoFalse, msoScaleFromTopLeft
GoTo Fin
erreur:
MsgBox "Vérifier si la photo est dans le répertoire"
Fin:
Exit Sub
End Sub
Je sollicite votre aide, car si j'ai réussi à introduire des photos dans mon tableau, et à les faire apparaitre au bon endroit, je ne parviens pas à effacer la photo n-1 avant d'introduire la photo n.
Merci pour ce que vous allez faire pour moi.
Sub Test()
Dim Val1
Val1 = Sheets("Autorisations de conduite").[E2].Value
Dim val2 As String
val2 = ThisWorkbook.Path & "\Photos\"
Dim val3 As String
val3 = val2 & Val1 & ".jpg"
Range("E2").Select
On Error GoTo erreur
ActiveSheet.Pictures.Insert(val3).Select
Selection.ShapeRange.IncrementLeft 235
Selection.ShapeRange.IncrementTop 100
Selection.ShapeRange.Height = 172.25
Selection.ShapeRange.Width = 173.75
Selection.ShapeRange.ScaleWidth 0.68, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.67, msoFalse, msoScaleFromTopLeft
ActiveSheet.Pictures.Insert(val3).Select
Selection.ShapeRange.IncrementLeft 235
Selection.ShapeRange.IncrementTop 690
Selection.ShapeRange.Height = 172.25
Selection.ShapeRange.Width = 173.75
Selection.ShapeRange.ScaleWidth 0.68, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.67, msoFalse, msoScaleFromTopLeft
GoTo Fin
erreur:
MsgBox "Vérifier si la photo est dans le répertoire"
Fin:
Exit Sub
End Sub