|
- Sub 按钮1_Click()
- a = 1
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- For Each f In fso.getfolder(ThisWorkbook.Path).Files
- If InStr(f.Name, ".xls") = 0 Then
- Cells(a, 1).Select
- Set Rng = Selection
- pth = f
- Set photo = ActiveSheet.Pictures.Insert(pth)
- With photo
- .Name = f.Name
- .ShapeRange.LockAspectRatio = msoFalse
- .Top = Rng.Top
- .Left = Rng.Left
- .Width = Rng.Width
- .Height = Rng.Height
- End With
- Cells(a + 3, 3) = fso.GetFile(f).DateCreated
- Cells(a + 2, 3) = Split(f.Name, ".")(0)
- a = a + 9
- End If
- Next f
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|