Gruppe
Datei
Problem
Wie kann ich in der aktiven Tabelle in Spalte A Hyperlinks zu allen Excel-Dateien eines bestimmten Verzeichnisses erstellen?
StandardModule: basMain
Sub SetHyperlinks()
Dim arr As Variant
Dim iCounter As Integer
ActiveSheet.Hyperlinks.Delete
Range("A2:A65536").ClearContents
With Application.FileSearch
.LookIn = Range("B1").Value
.FileType = msoFileTypeExcelWorkbooks
.Execute
For iCounter = 1 To .FoundFiles.Count
Cells(iCounter + 1, 1).Value = .FoundFiles(iCounter)
ActiveSheet.Hyperlinks.Add _
Anchor:=Cells(iCounter + 1, 1), _
Address:=.FoundFiles(iCounter)
Next iCounter
End With
Columns(1).AutoFit
End Sub