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
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.