|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
回复 5楼 linn339q 的帖子
其他代码不变,aaa修改如下:
Sub aaa()
Dim n As Integer, i As Integer, j As Integer
Dim wb As Workbook, sht As Worksheet, c As Range, a
Application.ScreenUpdating = False
m = 2
ReDim ary(1 To m)
ary(1) = ThisWorkbook.Path & "\"
i = 1
Do While ary(i) <> ""
dirdir (ary(i))
i = i + 1
Loop
For Each cel In ary
If cel <> "" Then Call dirf(cel)
Next
Columns(1).Clear
For i = 2 To UBound(ary) - 1
n = n + 1
a = Split(ary(i), "\")
ActiveSheet.Hyperlinks.Add Anchor:=Cells(i - 1, 1), Address:=ary(i), TextToDisplay:=a(UBound(a) - 1)
Next
For i = 1 To UBound(arr)
a = Split(arr(i), "\")
ActiveSheet.Hyperlinks.Add Anchor:=Cells(i + n, 1), Address:=arr(i), TextToDisplay:=a(UBound(a))
Next
m = 0
mm = 0
Erase ary, arr
Application.ScreenUpdating = True
MsgBox "完毕"
End Sub |
|