Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I am using John Walkenbach's code to find the file name only from a full path string. My structure is as follows: PARENT_DIR | SUB_DIRECTORY | ThisWorkbook I wish to ascertain the parent directory name. I have working code (below) but am wondering if there's a simpler way to achieve this: Dim sInitPath As String Dim sNewPath As String Dim sParentDir as string sInitPath = CurDir sNewPath = ThisWorkbook.Path & "\..\" ChDrive sNewPath ChDir sNewPath sParentDir = FileNameOnly(CurDir) ChDrive sInitPath ChDir sInitPath Thanks in advance Paul Martin Melbourne, Australia |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ascertaining whether external data sources or hyperlinks exist | Excel Discussion (Misc queries) | |||
sum sub levels. | Excel Discussion (Misc queries) | |||
open in old directory save in new directory | Excel Programming | |||
Creating a macro that lists directory names within a directory.... | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming |