Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi
I would like to read all the files in a folder the files beginning with a "W" i would like to copy the file name into excel as a list any ideas how this is done thanks kevin |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Try this with the path changed to your required path Sub LoopThroughDirectory() Application.DisplayAlerts = False 'Change this to your directory MyPath = "C:\" activefile = Dir(MyPath & "*.xls") Do While activefile < "" If UCase(Left(activefile, 1)) = "W" Then Cells(Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1, 1) = activefile End If activefile = Dir() Loop Application.DisplayAlerts = True End Sub Mike "kevcar40" wrote: hi I would like to read all the files in a folder the files beginning with a "W" i would like to copy the file name into excel as a list any ideas how this is done thanks kevin |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On 10 Sep, 09:43, Mike H wrote:
Hi, Try this with the path changed to your required path Sub LoopThroughDirectory() Application.DisplayAlerts = False 'Change this to your directory MyPath = "C:\" activefile = Dir(MyPath & "*.xls") Do While activefile < "" * If UCase(Left(activefile, 1)) = "W" Then Cells(Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1, 1) = activefile * End If activefile = Dir() Loop Application.DisplayAlerts = True End Sub Mike "kevcar40" wrote: hi I would like to read all the files in a folder the files beginning with a "W" i would like to copy the file name into excel as a list any ideas how this is done thanks kevin- Hide quoted text - - Show quoted text - thank you works a treat |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get Excel 2007 to 'read' cell contents to me, vocally? | Excel Discussion (Misc queries) | |||
read contents of col1 and extract similars | Excel Discussion (Misc queries) | |||
read contents of col 1 and extract similar strings | Excel Discussion (Misc queries) | |||
read contents of column 1 for particular string | Excel Discussion (Misc queries) | |||
Excel formula to read contents | Excel Discussion (Misc queries) |