I have a column in an Excel spreadsheet that has around 40k records in it, the column is part of a much larger spreadsheet with multiple columns. Each row in the spreadsheet has a varying directory path...
I am looking for a way in VBA to clear out the directory path leaving just the filename (preferably without the file extension). Belowut this runs I found to try and acheive this - but this runs very very slowly and is not an option..
Does anyone know a quick way of achieving this?
Function GetFilenameFromPath(ByVal strPath As String) As String
If Right$(strPath, 1) <> "\" And Len(strPath) > 0 Then
GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, Len(strPath) - 1)) + Right$(strPath, 1)