|
楼主 |
发表于 2018-6-19 11:20
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我自己写了一段代码,但是不管用啊。
- Private Sub CommandButton1_Click()
- Dim FilePath$, FileName$, dic As Object, obj As Object, m$, s$, p, f
- Set obj = CreateObject("Scripting.FileSystemObject")
- Set dic = CreateObject("Scripting.Dictionary")
- FilePath = ThisWorkbook.Path & "\原始表"
- FileName = Dir(FilePath & "\*.xls")
-
- Do While FileName <> ""
- m = Left(FileName, 7)
- dic(m) = dic(m) + 1
- If dic(m) = 1 Then
- MsgBox "没重复"
- Exit Sub
- Else: MsgBox "有重复"
- Exit Sub
- End If
- Loop
-
- End Sub
复制代码
|
|