|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test1()
- Dim p As String, f As String, r As Long
- r = 2
- Range("A1") = "工作簿名"
- Range("A1").CurrentRegion.Columns(1).Offset(1).Clear
- p = ThisWorkbook.Path & "\"
- f = Dir(p & "*.xls?")
- While Len(f)
- If f <> ThisWorkbook.Name Then
- ActiveSheet.Hyperlinks.Add Range("A" & r), p & f, "", "点击链接到 " & f, Split(f, ".xls")(0)
- r = r + 1
- End If
- f = Dir
- Wend
- With Range("A1").CurrentRegion.Columns(1)
- .Borders.LineStyle = 1
- .Font.Underline = -4142
- End With
- End Sub
复制代码 |
|