Sub yazl()
InsertAllPix Range("A1"), _
"C:\Documents and Settings\yazl\My Pictures\My Directory", _
"*.jpg"
End Sub
Sub InsertAllPix(r As Range, ByVal sDir As String, sFilt As String)
Dim sPic As String
Dim iRow As Long
If Right(sDir, 1) <> "\" Then sDir = sDir & "\"
sPic = Dir(sDir & sFilt)
Do While Len(sPic)
iRow = iRow + 1
With ActiveSheet.Pictures.Insert(sDir & sPic)
.ShapeRange.LockAspectRatio = msoFalse
.Height = r(iRow, 1).Height
.Width = r(iRow, 1).Width
.Top = r(iRow, 1).Top
.Left = r(iRow, 1).Left
.Placement = xlMoveAndSize
End With
sPic = Dir
Loop
End Sub
Bookmarks