Littleiitin
In respect to item 2 - I have tested your code - works great - But is there a way to place a text string into the header of the Listbox - I basically fill the values into mylistbox using the FileDialog - so it is a list of files that I then add to the List box with the .additem property for the first column (name of excel file) and .list(i,1) is the path of that file. But I would like to add the headers "FileName" & "Filepath" without reading a range or region from my sheet.
Below is my code to get the selection of files that I then add into the listbox
Code:
Sub UseFileDialogOpen(ByRef SltFile() As String, ByVal MuliSelect As Boolean, ByRef strPath As String)
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = strPath
End With
With Application.FileDialog(msoFileDialogOpen)
If MuliSelect Then
.AllowMultiSelect = True
Else
.AllowMultiSelect = False
End If
.Show
' Display paths of each file selected
ReDim SltFile(.SelectedItems.Count)
For i = 1 To .SelectedItems.Count
SltFile(i - 1) = .SelectedItems(i)
Next i
End With
End Sub
Bookmarks