Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Privacywetgeving
Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.
Sub mvh()
Dim startTime As Single 'start timer
Application.ScreenUpdating = False
bestanden = Split(CreateObject("wscript.shell").exec("cmd /c dir c:\users\georges\documents\*.* /a-d /b /s").stdout.readall, vbCrLf)
For i = 0 To UBound(bestanden)
Cells(i + 1, 1) = bestanden(i)
Next i
MsgBox ("run time: " & Format((Timer - startTime) / 1000000, "#,##0.00") & " seconds") 'end timer
End Sub
'Create the object of this folder
Set objFolder = FSO.GetFolder(strPath)
'Check if the folder is empty or not
If objFolder.Files.Count = 0 Then
MsgBox "No files were found...", vbExclamation
Exit Sub
End If
'Adding Column names for A, B, and C
Cells(1, "A").Value = "File Name"
Cells(1, "B").Value = "Size"
Cells(1, "C").Value = "Modified Date/Time"
'Find the next available row
NextRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1
'Loop through each file in the folder
For Each objFile In objFolder.Files
'List the name, size, and date/time of the current file
Cells(NextRow, 1).Value = objFile.Name
Cells(NextRow, 2).Value = objFile.Size
Cells(NextRow, 3).Value = objFile.DateLastModified
Dim oFSO As Object, ar(80000, 3), x As Long
Sub jec()
Application.ScreenUpdating = False
Set oFSO = CreateObject("Scripting.FileSystemObject")
GetFiles "C:\Users\xxx\Downloads"
If x Then
Cells(1, 1).Resize(, 5) = Array("Name", "Extension", "DateLastAccessed", "DateLastModified", "DateCreated")
Cells(2, 2).Resize(x, 4) = ar
End If
Erase ar: x = 0
End Sub
Sub GetFiles(xFold)
Dim Obj As Object
If Right(xFold, 1) <> "\" Then xFold = xFold & "\"
With oFSO.GetFolder(xFold)
For Each Obj In .Files
ActiveSheet.Hyperlinks.Add Cells(x + 2, 1), Obj, , ,Split(Obj.Name, ".")(0)
ar(x, 0) = oFSO.GetExtensionName(Obj)
ar(x, 1) = Obj.DateLastAccessed
ar(x, 2) = Obj.DateLastModified
ar(x, 3) = Obj.DateCreated
x = x + 1
Next
For Each Obj In .SubFolders
GetFiles xFold & Obj.Name
Next
End With
End Sub
Dim oFSO As Object, ar(80000, 4), x As Long
Sub mvh()
Application.ScreenUpdating = False
Set oFSO = CreateObject("Scripting.FileSystemObject")
GetFiles "C:\Users\georges\documents"
If x Then
Cells(1, 1).Resize(, 6) = Array("Name", "Folder", "Extension", "DateLastAccessed", "DateLastModified", "DateCreated")
Cells(2, 2).Resize(x, 5) = ar
End If
Erase ar: x = 0
End Sub
Sub GetFiles(xFold)
Dim Obj As Object
If Right(xFold, 1) <> "\" Then xFold = xFold & "\"
With oFSO.GetFolder(xFold)
For Each Obj In .Files
ActiveSheet.Hyperlinks.Add Cells(x + 2, 1), Obj, , , Obj.Name
ar(x, 0) = xFold
ar(x, 1) = oFSO.GetExtensionName(Obj)
ar(x, 2) = Obj.DateLastAccessed
ar(x, 3) = Obj.DateLastModified
ar(x, 4) = Obj.DateCreated
x = x + 1
Next
For Each Obj In .SubFolders
GetFiles xFold & Obj.Name
Next
End With
End Sub
Sub mvh()
Start = Timer
Application.ScreenUpdating = False
Set oFSO = CreateObject("Scripting.FileSystemObject")
GetFiles "C:\Users\georges\documents"
If x Then
Cells(1, 1).Resize(, 6) = Array("Name", "Folder", "Extension", "DateLastAccessed", "DateLastModified", "DateCreated")
Cells(2, 2).Resize(x, 5) = ar
End If
Erase ar: x = 0
MsgBox Round(Timer - Start, 2) & " sec."
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.