Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, as far as I know, you would need a VBA macro to do this. You didn't
tell us where you wanted the list to be, so I had to make a guess. Assuming your "location" (the c:\tenp you mentioned) is in a cell, select that cell and this macro will put the directory names in the same column underneath it and the last modified dates for them will be in the column next to it... Dim Count As Long Dim FileName As String Dim LocationPath As String LocationPath = ActiveCell.Value If Right(LocationPath, 1) < "/" Then LocationPath = LocationPath & "\" FileName = Dir(LocationPath & "*", vbDirectory) Count = ActiveCell.Row Do While Len(FileName) If (GetAttr(LocationPath & FileName) And vbDirectory) = vbDirectory Then If FileName < "." And FileName < ".." Then Count = Count + 1 Cells(Count, ActiveCell.Column).Value = FileName Cells(Count, ActiveCell.Column + 1).Value = _ FileDateTime(LocationPath & FileName) End If End If FileName = Dir() Loop -- Rick (MVP - Excel) "HHH" wrote in message ... How can i list all folders and last modified dates in a particular location? for example if the location was c:\temp, i would expect a list of folders (not files) and the last date modified....?? Does this involve using excel vba script? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I create folders in explorer from an excel list | Excel Discussion (Misc queries) | |||
How do I find a list of dates a file has been modified? | Excel Discussion (Misc queries) | |||
Generate document folders for Excel list. | Excel Programming | |||
List Folders using Excel | Excel Programming | |||
Can anyone help me Create Excel list of files in windows folders | Excel Worksheet Functions |