Hi!
I was trying to list file from folder bit i only get 15 rows.
It should be about 650 rows?
thx in davance
I was trying to list file from folder bit i only get 15 rows.
It should be about 650 rows?
Code:
Sub CheckFile()
Dim sFolder As String
sFolder = "C:\Folder\"
Call CheckPath(sFolder)
End Sub
Sub CheckPath(sFolder As String)
Dim sPath As String
Dim sFile() As String
Dim TotFile As Integer
Dim i As Integer
Dim x As Integer
sPath = Dir$(sFolder & "*.*", vbDirectory)
TotFile = 0
x = 0
While sPath <> ""
If sPath <> "." And sPath <> ".." Then
If (GetAttr(sFolder & sPath) And vbDirectory) = vbDirectory Then
TotFile = TotFile + 1
ReDim Preserve sFile(TotFile)
sFile(TotFile) = sFolder & sPath & "\"
Else
x = x + 1
ThisWorkbook.Worksheets("Sheet1").Cells(x, 6).Value = sPath
End If
End If
sPath = Dir$()
Wend
If TotFile <> 0 Then
For i = 1 To TotFile
Call CheckPath(sFile(i))
Next i
End If
End Sub
thx in davance