wo soll ich folgende Code ändern damit die Dateien in "C9" aufgelistet werden?
Option Explicit
Sub Ordner_Inhalte_mit_Hyperlink_Auslesen()
'Excel Dateien mit HyperlinkAuflisten
Const PFAD As String = "C:\Users\a.mazza\Desktop\VBA"
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(PFAD)
Range("C9:C" & Rows.Count).ClearContents
'Range("D9:D" & Rows.Count).ClearContents
For Each objFile In objFolder.Files
If Left(Right(objFile.Name, Len(objFile.Name) _
- InStrRev(objFile.Name, ".") + 1), 4) = ".xls" Then
ActiveSheet.Hyperlinks.Add Anchor:=Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0), Address:=objFile.Path, _
TextToDisplay:=objFile.Name
End If
Next 'objFile
'For Each objFile In objFolder.Files
' If Left(Right(objFile.Name, Len(objFile.Name) _
' - InStrRev(objFile.Name, ".") + 1), 4) = ".jpg" Then
' ActiveSheet.Hyperlinks.Add Anchor:=Cells(Rows.Count, 4) _
' .End(xlUp).Offset(1, 0), Address:=objFile.Path, _
' TextToDisplay:=objFile.Name
' End If
'Next 'objFile
Set objFile = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
End Sub
Vielen Dank in VorausAntonio