Hallo wie kann ich den Range auf Spalte F begrenzen und das die Links in der selben Zeile untereinander aufgelistet werden?
Danke
Private Sub CommandButton1_Click()
Dim OutPut As Integer
OutPut = MsgBox("Please make sure Files are stored in" & _
vbCrLf & "_PoM_FileFolder", vbInformation, "INFO")
Dim fd As FileDialog
Dim FilePicked As Integer
Dim UserRange As Range, UserCell As Range
Set fd = Application.FileDialog(msoFileDialogFilePicker)
' Change initial folder as needed or store it in a cell and reference that
fd.InitialFileName = "c:\Temp\"
fd.AllowMultiSelect = True
FilePicked = fd.Show
If FilePicked = 0 Then
Dim OutPut1 As Integer
OutPut1 = MsgBox("You have canceled the file link import", vbExclamation, "FILE LINK IMPORT")
Else
'Using inputbox to get selected Range
Set UserRange = Application.InputBox(Prompt:="Please Select a Cell", Title:="Cell Select", Type:=8)
'Get first cell of selected range
Set UserCell = UserRange.Cells(1)
'loop through selecteditems from FileDialog and create hyperlink offsetting cell by 1 column each time
For i = 1 To fd.SelectedItems.Count
UserCell.Hyperlinks.Add Anchor:=UserCell, Address:=fd.SelectedItems(i)
Set UserCell = UserCell.Offset(0, 1)
Next
End If
End Sub
|