excel - Go up one folder level -
i have macro gets sub folder data. want main folder.
i looked @ how current working directory using vba? need change activeworkbook path:
application.activeworkbook.path might "c:\parent\subfolder"
i want
"c:\parent\"
using excel 365 vba
as path may not current working directory need extract path string.
find last \
, read characters left:
parentpath = left$(path, instrrev(path, "\"))
if working around current directory chdir ".."
jump 1 level, new path can returned currdir
.
Comments
Post a Comment