Function 上级文件夹(path, Optional k = 1) arr = Split(path, "\") For i = 0 To UBound(arr) - k s = s & "\" & arr(i) Next 上级文件夹 = Mid(s, 2) End Function