另外 目前新增功能 如果中间再插入步骤的话 步骤号码会自动再跳号不必手动修改!
整个档案部分内容放置图一
完整档案放置在最后一页
但是写完VBA 不知道出了什么问题 仍然无法使用?
成果是希望如此档案 http://1drv.ms/1AnLV1s
Sub Ex()
Dim Fs As Object, E, i As Integer, P, ii As Integer
With CreateObject("Scripting.FileSystemObject").GetFolder("d:\相片\") '<-修改
为你要查询之资料夹假设在d槽
i = 1
For Each E In .SubFolders
If i > ActiveWorkbook.Sheets.Count Then
Sheets.Add(, Sheets(Sheets.Count)).Name = E.Name
Else
Sheets(i).Name = E.Name '<-新档名取代品名以及旧档名
End If
ii = 1
For Each P In E.Files
If InStr(UCase(P.Name), ".JPG") Then
With Sheets(i).Pictures.Insert(P)
.Top = Cells(ii, 2).Top
.Left = Cells(ii, 2).Left
.Width = 50
.Height = 50
End With
ii = ii + 5
End If
Next
i = i + 1
Next
Dim St As Worksheet: Set St = ThisWorkbook.Worksheets("Sheet1")
Dim Mx
Workbooks.Open "D:\Book2.xls"假设在档名为Book2
Mx = Range(St.[A1], St.[C10])
Workbooks("Book2").Sheets("Sheet1").[A1].Resize(UBound(Mx, 1), UBound(Mx, 2))
= Mx
Workbooks("Book2").Close True
End With
End Sub