Makro Start ab Zeile...
22.04.2005 12:25:21
Michael
Hab das Problem unten schon mal angerissen, jetzt gehts anstatt der Spalte um die Zeile:
Wie/wo kann ich bestimmen, dass das Makro die Liste ab einer bestimmten Zeile (hier: 7) startet, anstatt in der 1. Zeile?
Danke schon jetzt
M.
Sub Hyperlinks_einfügen()
Dim strFolder As String
Dim icount As Integer
Dim i As Integer
Dim j As Integer
Worksheets(1).Columns(8).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 = "*.*"
.SearchSubFolders = False
.Execute
icount = .FoundFiles.Count
For i = 1 To icount
Worksheets(1).Hyperlinks.Add anchor:=Worksheets(1).Cells(i, 8), Address:=.FoundFiles(i)
For j = Len(Cells(i, 8)) To 1 Step -1
If Cells(i, 8).Characters(j, 1).Text = "\" Then
Cells(i, 8) = Right(Cells(i, 8), Len(Cells(i, 8)) - j)
Exit For
End If
Next j
Next i
End With
Worksheets(1).Columns("H:H").AutoFit
End Sub