G
GEORGEBEKOS
IS THERE A WAY TO GET FOLDER NAMES FROM PATH TO EXCEL WITHOUT THE FILE
IN THEM
(ONLY THE FOLDER NAMES
IN THEM
(ONLY THE FOLDER NAMES
Tom Ogilvy said:Use the example for the Dir command: (modified to perform what your code
does)
' Display the names in H:\JAZZ that represent directories.
MyPath = "H:\JAZZ" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
i = 0
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
i = i + 1
cells(i,1).Value = MyName ' Display entry only if it
End If ' it represents a directory.
End If
MyName = Dir ' Get next entry.
Loop
Assumes you only want first level directories.
What do you mean by size - in kb sum of all the file sizes?