Hi i've got this Marco/Function
Sub get_files()
Extension = "*.CSV"
Folder = "C:\Documents and Settings\User\My Documents
First = True
RowCount = 1
Do
If First = True Then
FName = Dir(Folder & "\" & Extension)
First = False
Else
FName = Dir()
End If
If FName <> "" Then
Range("A" & RowCount) = FName
RowCount = RowCount + 1
End If
Loop While FName <> ""
End Sub
It will list everything in the My documents files
But its not searching the Subfolders and listing the name in the Directory
I know a few things about VBA but don't know what to do to ajust it to search for Subfolders can anyone help
Thanks
Graham
Sub get_files()
Extension = "*.CSV"
Folder = "C:\Documents and Settings\User\My Documents
First = True
RowCount = 1
Do
If First = True Then
FName = Dir(Folder & "\" & Extension)
First = False
Else
FName = Dir()
End If
If FName <> "" Then
Range("A" & RowCount) = FName
RowCount = RowCount + 1
End If
Loop While FName <> ""
End Sub
It will list everything in the My documents files
But its not searching the Subfolders and listing the name in the Directory
I know a few things about VBA but don't know what to do to ajust it to search for Subfolders can anyone help
Thanks
Graham