How do I parse this path
C:\Program Files\Denali\Databases\2010\asdasdasdasd2010652\
I want it to return
\Denali\Databases\2010\asdasdasdasd2010652\]
I need everything before "\Denali" removed no matter what is there.
Printable View
How do I parse this path
C:\Program Files\Denali\Databases\2010\asdasdasdasd2010652\
I want it to return
\Denali\Databases\2010\asdasdasdasd2010652\]
I need everything before "\Denali" removed no matter what is there.
vb Code:
x = Instr(path,"\Denali") If x then newpath = mid$(path, x) else msgbox "denali not found" end if
Just a small addition to FireXtol's code, changed first line to make it work regardless of letter case
x = Instr(LCase$(path),"\denali")
One more way...
Code:Dim strPath As String, MyArray() As String
strPath = "C:\Program Files\Denali\Databases\2010\asdasdasdasd2010652\"
MyArray = Split(strPath, "\Denali\")
If UBound(MyArray) > 0 Then MsgBox Replace(strPath, MyArray(0), "") _
Else MsgBox "Not Found"
WOW great stuff guys. Thank you so much for the help.