Sub PHOTO()
ActiveSheet.Columns("C") = ""
Set Sh = ActiveSheet
With Sh
.Pictures.Delete
End With
fs = Dir("G:\picture\A00001\*.jpg")
Do Until fs = ""
R = R + 1
Cells(1, R + 1) = fs
Cells(2, R + 1).Select
ActiveSheet.Pictures.Insert("G:\picture\A00001\" & Cells(1, R + 1)).Select
With Selection
.Top = ActiveSheet.Cells(2, R + 1).Top + 1
.Left = ActiveSheet.Cells(2, R + 1).Left + 1
.Width = ActiveSheet.Cells(2, R + 1).Width - 1
.Height = ActiveSheet.Cells(2, R + 1).Height - 1
End With
fs = Dir
Loop
End Sub作者: Joforn 時間: 2015-12-8 12:52