My code prompts the user to select a file. I want to set a variable to the folder name of the file location but the file is located in a subfolder.
I have this code to open the file.
fileAndPath = Application.GetOpenFilename(FileFilter:="Excel Files (*.csv), _
*.csv", Title:="Select a file")
If fileAndPath = False Then Exit Sub
This is the filepath C:\Store Location\Employees\Contact Information\Phone Numbers\11373
I want to extract the 11373 part and store it as a variable