我是VBA的新手,我正在处理以下任务:
nPath = "Root\zTrash - No longer needed\NOC\NOC"
我希望从nPath
中移除\NOC
,以便只显示Root\zTrash - No longer needed
。
我在使用以下代码:
=(Left(nPath, InStrRev(nPath, "\") - 1))
但我只得到了NOC
我是VBA的新手,我正在处理以下任务:
nPath = "Root\zTrash - No longer needed\NOC\NOC"
我希望从nPath
中移除\NOC
,以便只显示Root\zTrash - No longer needed
。
我在使用以下代码:
=(Left(nPath, InStrRev(nPath, "\") - 1))
但我只得到了NOC