Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hi, Esra !
I want to get a folder listing (from a specific folder) that shows sub folders in the next column (under the parent folder)... does a vba-macro serves well ? Sub List_Subfolders() Dim StartPath As String, FName As String, n As Integer StartPath = Range("a1").Text If Right(StartPath, 1) < "\" Then StartPath = StartPath & "\" FName = Dir(StartPath & "*", vbDirectory) Do While FName < "" If (GetAttr(StartPath & FName) And vbDirectory) = vbDirectory Then _ If FName < "." And FName < ".." Then _ Range("b1").Offset(n) = FName: n = n + 1 FName = Dir() Loop End Sub hth, hector. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Listing Folder Contents into a Column | Excel Worksheet Functions | |||
Listing the contents of a folder | Excel Discussion (Misc queries) | |||
Followup: Folder listing | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
Periodically listing files in a folder | Excel Discussion (Misc queries) |