|
仮に C:\My Documents\My Pictres に保存しているとして
Sub MyPic_Ins()
Dim i As Integer
Dim Tp As Single, Wp As Single, Hp As Single
With Application.FileSearch
.LookIn = "C:\My Documents\My Pictres"
.FileName = "*.jpg"
.FileType = msoFileTypeAllFiles
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
With Cells(i, 1)
Tp = .Top: Wp = .Width: Hp = .Height
End With
With ActiveSheet.Pictues.Insert(.FoundFiles(i))
.Left = 0: .Top = Tp: .Width = Wp: .Height = Hp
End With
Next i
End With
End Sub
ベタ書きしただけなので、うまくいくかどうか全く不明です。あしからず。
|
|