Application: Excel
Left(ThisWorkbook.Path, InStrRev(ThisWorkbook.Path, "\") - 1)
I need to go back at least 2 Folders from the Workbook Path.
I cannot use Paths like "C:/Folder1", because the Application will be moved multiple times.
Like this:
Function getParentFolder2(ByVal strFolder0)
Dim strFolder
strFolder = Left(strFolder0, InStrRev(strFolder0, "\") - 1)
getParentFolder2 = Left(strFolder, InStrRev(strFolder, "\") - 1)
End Function
Dim strFolder
strFolder = getParentFolder2(ThisWorkbook.Path)
We here cut twice \subdir pattern...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments