Sub PictureResize()
Application.ScreenUpdating = False
Dim p As Object
Dim i%, k&, h&
With Application.FileSearch
.LookIn = "D:\my Documents\My Pictures" '資料夾自己設
.FileType = msoFileTypeAllFiles
.Filename = "*.jpg"
.Execute
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set p = ActiveSheet.Pictures.Insert(.FoundFiles(i))
p.Left = Cells(i, 1).Left
p.Top = Cells(i, 1).Top
p.Width = Cells(i, 1).Width
p.Height = Cells(i, 1).RowHeight
Next
End If
End With
Set p = Nothing
Application.ScreenUpdating = True
End Sub作者: Hsieh 時間: 2012-3-31 17:19