AW: Daten neu einlesen, Rahmen löschen
15.11.2020 10:36:05
Werner
Hallo,
nein, da wird gar nix gelöscht.
Public Sub Inhaltsverzeichnis()
Dim objFileSearch As clsFileSearch, objFileDialog As FileDialog
Dim ialngIndex As Long, lngFileCount As Long, lngColumn As Long
Dim strFolder As String
Set objFileDialog = Application.FileDialog(fileDialogType:=msoFileDialogFolderPicker)
Application.ScreenUpdating = False
With objFileDialog
.AllowMultiSelect = False
.ButtonName = "Auswählen"
.Title = "Ordner auswählen"
.InitialFileName = ThisWorkbook.Path
If .Show Then strFolder = .SelectedItems(1)
End With
Set objFileDialog = Nothing
If strFolder vbNullString Then
Set objFileSearch = New clsFileSearch
With Tabelle1
For lngColumn = 1 To 11
Call .Range(.Cells(4, lngColumn), Cells(.Rows.Count, lngColumn)).ClearContents
Next
End With
With objFileSearch
.CaseSenstiv = False
.Extension = "*.*"
.FolderPath = strFolder
.SubFolders = True
For lngColumn = 2 To 11 Step 3
.NewSearch = True
.SearchLike = Switch(lngColumn = 2, "GB", lngColumn = 5, "BA", _
lngColumn = 8, "BG", lngColumn = 11, "XX") & "*"
lngFileCount = .Execute(Sort_by_Name, Sort_Order_Ascending)
For ialngIndex = 1 To lngFileCount
Call Tabelle1.Hyperlinks.Add(Anchor:=Tabelle1.Cells(ialngIndex + 3, lngColumn), _
_
Address:=.Files(ialngIndex).Path, TextToDisplay:=.Files(ialngIndex).Filename)
Tabelle1.Cells(ialngIndex + 3, 1) = ialngIndex
Next
Next
End With
Set objFileSearch = Nothing
End If
End Sub
Gruß Werner