1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| 'On insère une ligne vide entre chaque résultat obtenu et on adapte la hauteur pour préparer l'insertion de la photo
Dim a As Integer
a = 3
Do While Sheets("RESULTAT").Cells(a - 1, 1).Value <> Empty
Rows(a).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.RowHeight = 200
'On insère la photo correspondant à la désignation
Dim Image As String
With Sheets("RESULTAT")
Image = "G:\" & Sheets("RESULTAT").Cells(a - 1, 4).Value & ".jpeg"
'Image: chemin fichier, 0: non liée, 1: enregistrer avec document, Gauche, Haut, Largeur, Hauteur
.Shapes.AddPicture Image, 0, 1, .Cells(a, 3).Left, .Cells(a, 3).Top, 70, 50
End With
a = a + 2
Loop |
Partager