用宏,如下: EXCELHOME 高手多 到那问去
Private Sub filename()
With Application.FileSearch
.NewSearch
.LookIn = "path of the file"
.SearchSubFolders = True
.filename = "*.*"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
On Error Resume Next
ActiveSheet.Hyperlinks.Add Anchor:=Cells(i, 1), Address:= _
.FoundFiles(i), TextToDisplay:=.FoundFiles(i)
Next i
End If
End With
Range("B1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B2").Select
ActiveCell.FormulaR1C1 = "2"
Range("B3").Select
ActiveCell.FormulaR1C1 = "3"
Range("B1:B3").Select
Selection.AutoFill Destination:=Range("B1:B5000"), Type:=xlFillDefault
Range("C1").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-2],47,9)"
Range("C1").Select
Selection.AutoFill Destination:=Range("C1:C5000"), Type:=xlFillDefault
Range("C1:C2413").Select
End Sub