View Single Post
 
Old 01-13-2024, 09:41 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 208
RobiNew is on a distinguished road
Default Get the whole path before the last counterslash

I know how to get the last subfolder in a path (here below), but how do I get the whole path before the last counterslash? Thanks!
Code:
Sub BeforeCounterslash()
Dim StrText As String
StrText = Trim(Split("C:\Sub_1\Sub_2\Sub_3", "\")(3))
MsgBox StrText
End Sub
Reply With Quote