|
加上超链接。。。
- Sub ykcbf() '//2024.8.18
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set sh = ThisWorkbook.Sheets("Sheet1")
- p = ThisWorkbook.Path & ""
- st = "PDF|DOC|DOCX|XLS|XLSX|PPT"
- ReDim brr(1 To 1000, 1 To 4)
- For Each fd In fso.GetFolder(p).SubFolders
- If Val(fd.Name) <= 20 Then
- For Each f In fso.GetFolder(fd).Files
- fx = fso.GetExtensionName(f)
- If InStr(st, UCase(fx)) Then
- m = m + 1
- brr(m, 1) = CDate(fso.getfile(f).DateLastModified)
- brr(m, 2) = fd.Name
- brr(m, 3) = fso.GetBaseName(f)
- brr(m, 4) = f
- End If
- Next
- End If
- Next
- With sh
- .UsedRange.Offset(2).ClearContents
- .[a3].Resize(m, 4) = brr
- Set Rng = .[a3].Resize(m, 4)
- Rng.Sort Rng.Columns(1), 1
- For i = 3 To m + 2
- s = .Cells(i, 3)
- fn = .Cells(i, 4)
- .Hyperlinks.Add Anchor:=.Cells(i, 3), Address:=fn
- Next
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|