|
回复 7楼 高玉甫 的帖子
请测试:
Private Sub Workbook_Open()
Dim myPath$, myFile$, m As Integer
Application.ScreenUpdating = False
myPath = ThisWorkbook.Path & "\"
myFile = Dir(myPath & "*.xls")
m = 1
With Sheets("02")
.UsedRange.Offset(1, 0).Clear
Do While myFile <> ""
If myFile <> ThisWorkbook.Name Then
m = m + 1
.Hyperlinks.Add Anchor:=.Cells(m, 2), Address:=myPath & myFile, TextToDisplay:=Split(myFile, ".")(0)
End If
myFile = Dir
Loop
.Range("A2").Value = 1
If m > 2 Then .Range("A2").AutoFill Destination:=.Range("A2").Resize(m - 1), Type:=xlFillSeries
End With
Application.ScreenUpdating = True
End Sub |
|