Sub InsertPic()
Dim i As Integer 'counter for loop
Dim strPath As String 'string for path
Dim rng As Range 'range for top and left of image without loop
'this is to declare where photos are stored
'taken assumption that the photos are subdirectory of this file,change as required
strPath = ThisWorkbook.Path & "\Photos\"
i = 1
For i = 1 To 4
'set rng to where the the top and left of image will be. ie K8,K25,etc
Set rng = Cells(((i - 1) * 17) + 8, 11)
'take the Emp ID from column N
With ActiveSheet.Pictures.Insert(strPath & Cells(((i - 1) * 17) + 10, 14).Value & ".jpeg")
With .ShapeRange
.LockAspectRatio = msoFalse
.Width = 85
.Height = 35
End With
.Left = rng.Left
.Top = rng.Top
.Placement = 1
.PrintObject = True
End With
Next
End Sub
play around with the width/height until you get it right
**
to use test file make subdirectory of the attached file named "Photos" and place jpeg in there
Bookmarks