kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
When I remove the last slash from the path
It works fine to display "MyFolder". But when I place it back as below, it shows blank. How do I fix that?
Because I need that last slash in my path.
Thanks
Code:
FullPath = ThisWorkBook.Path & "\MyFolder"
It works fine to display "MyFolder". But when I place it back as below, it shows blank. How do I fix that?
Because I need that last slash in my path.
Thanks
Code:
Sub GetLastFolder()
FullPath = ThisWorkBook.Path & "\MyFolder\"
c = InStrRev(FullPath, "\")
LastFolder =Right(FullPath, Len(FullPath)-c)
Msgbox LastFolder
End Sub