我是VBA的新手,下面是我的代码无法正常工作,你可以帮忙吗?
Dim nPath1() As String
nPath1() = Split(nPath, "\")
'Declare path as integer
Dim path As Integer
'Getting array length
path = UBound(nPath1())
Dim lastname As String
'For Loop
For i = 0 To path-1
lastname += nPath1(i)+"\"
Next i
Run Code Online (Sandbox Code Playgroud)
上面的代码不起作用; 我的路径字符串是Root\zTrash - 不再需要\ NOC\NOC和我想要的是Root\zTrash - 不再需要\ NOC.