Another approach...
Sub tested()
Dim str As String
Dim var As Variant
str = "I:\Account_Documents\ABC\ABCXYZ\GOV Documents"
'zero based array is returned by the Split function.
var = VBA.Split(str, "\", -1)
MsgBox var(2) & vbCr & var(3)
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"DK"
wrote in message I have extracted a directory listing like:
I:\Account_Documents\ABC\ABCXYZ\GOV Documents
I want to extract the third directory (ABC) into one column and fourth
directory (ABCXYZ) in another column from the whole.
How can I do this quickly?