|
![](https://clubstatic.excelhome.net/image/common/ico_lz.png)
楼主 |
发表于 2018-12-9 11:40
|
显示全部楼层
- Sub 按钮1_Click()
- Set d = CreateObject("scripting.dictionary")
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- For Each fd In fso.getfolder(ThisWorkbook.Path).subfolders
- For Each f In fd.Files
- str1 = Split(f.Name, ".")(0)
- d(fd.Name & str1) = "√"
- Next f
- Next fd
- [c4:d13].ClearContents
- Set Rng = Nothing
- For j = 4 To 13
- For i = 3 To 4
- If d.exists(Cells(3, i) & Cells(j, 2)) Then
- Cells(j, i) = d(Cells(3, i) & Cells(j, 2))
- Else
- If Rng Is Nothing Then
- Set Rng = Cells(j, i)
- Else '
- Set Rng = Union(Rng, Cells(j, i))
- End If
- End If
- Next i
- Next j
- If Not Rng Is Nothing Then Rng.Interior.ColorIndex = 3
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|