When I use the file search code, I hae the results being entered in to a cell, as well as populating a combobox. The problem is that it returns the path name as well as the file name. Is there a way to have it return JUST the file name?
Thanks
Code:
With Application.FileSearch
.NewSearch
.LookIn = "H:\Test Data\"
.SearchSubFolders = False
.Filename = "*.csv"
.Execute
For i = 1 To .FoundFiles.Count
Windows("Report Generator.xls").Activate
ActiveCell.Value = .FoundFiles(i)
cboFilesList.AddItem (.FoundFiles(i))
ActiveCell.Offset(1, 0).Activate
Next i
End With
Thanks