I need to extract the filename from a path (a string):
e.g., \"C:\\folder\\folder\\folder\\file.txt\" = \"file\" (or even \"file.txt\" to get me sta
`You can also try:
Sub filen()
Dim parts() As String
Dim Inputfolder As String, a As String
'Takes input as any file on disk
Inputfolder = Application.GetOpenFilename("Folder, *")
parts = Split(Inputfolder, "\")
a = parts(UBound(parts()))
MsgBox ("File is: " & a)
End Sub
This sub can display Folder name of any file