|
- Sub Macro1()
- On Error Resume Next
- Dim fs, d, i&, j%, rng As Range
- Set fs = CreateObject("scripting.FileSystemObject")
- Set d = CreateObject("scripting.dictionary")
- mypath = ThisWorkbook.Path & ""
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- For i = Sheets.Count To 1 Step -1
- If Sheets(i).Name <> "界面" Then Sheets(i).Delete
- Next
- For Each f In fs.GetFolder(mypath).SubFolders
- wj = Dir(f & "\*.*")
- Do While wj <> ""
- w = Split(wj, ".")(0)
- If Not d.Exists(w) Then
- d(w) = f & "" & wj
- Else
- d(w) = d(w) & " " & f & "" & wj
- End If
- wj = Dir
- Loop
- Next
- a = d.Keys: b = d.Items
- For i = 0 To d.Count - 1
- x = Split(b(i))
- With Sheets.Add(after:=Sheets(Sheets.Count))
- .Name = a(i)
- For j = 0 To UBound(x)
- Set rng = .Cells(1, j * 4 + 1).Resize(10, 3)
- .Shapes.AddShape(msoShapeRectangle, rng.Left, rng.Top, rng.Width, rng.Height).Select
- Selection.ShapeRange.Fill.UserPicture x(j)
- Next
- End With
- Next
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
查看全部评分
|