Here is the modified version
Sub Get_All_SubDirectories()
Dim arSubDir() As String
Dim sSubDir As String
sSubDir = GetSubDir("d:\AR\", "*.dat")
' -----------------------------------------------------------
' Coded by Shasur for
http://vbadud.blogspot.com
' -----------------------------------------------------------
If LenB(sSubDir) <> 0 Then
arSubDir = Split(sSubDir, ";")
For i1 = 0 To UBound(arSubDir)
' Here you will get the list of Dat files
Debug.Print arSubDir(i1)
Next i1
End If
End Sub
http://www.dotnetdud.blogspot.com