Wie lege ich fest, in welcher Spalte das ein Makro eine Auflistung startet? Bis jetzt schreibt es in die Spalte A, das möchte ich gerne ändern...
Vielen Dank
Michael
Sub Hyperlinks_einfügen()
Dim strFolder As String
Dim icount As Integer
Dim i As Integer
Dim j As Integer
Worksheets(1).Columns(1).Clear
With Application.FileDialog(4)
.InitialFileName = "V:\"
.Title = "Ordner auswählen"
.ButtonName = "Auswahl"
.InitialView = 2
If .Show = -1 Then
strFolder = .SelectedItems(1)
Else
MsgBox "Keine Auswahl getroffen!"
End If
End With
With Application.FileSearch
.NewSearch
.LookIn = strFolder
.Filename = "*.doc"
.SearchSubFolders = False
.Execute
icount = .FoundFiles.Count
For i = 4 To icount
Worksheets(1).Hyperlinks.Add anchor:=Worksheets(1).Cells(i, 1), Address:=.FoundFiles(i)
For j = Len(Cells(i, 1)) To 1 Step -1
If Cells(i, 1).Characters(j, 1).Text = "\" Then
Cells(i, 1) = Right(Cells(i, 1), Len(Cells(i, 1)) - j)
Exit For
End If
Next j
Next i
End With
Worksheets(1).Columns("D:D").AutoFit
End Sub