Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through files
Hi,
I need to loop through all the files in a directory to extract data from a specific cell but without naming the files explicitly. Can anyone help please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through files
As a start...
Sub ProcessFiles() Dim FileDir As String Dim FName As String Application.ScreenUpdating = False FileDir = "C:\Files\" FName = Dir(FileDir) Do Until FName = "" Workbooks.Open FileDir & FName, False, True ''Add extracting code... ActiveWorkbook.Close False FName = Dir() Loop End Sub -- Jim Rech Excel MVP "Newbie" wrote in message ... | Hi, | | I need to loop through all the files in a directory to extract data from a | specific cell but without naming the files explicitly. | | Can anyone help please? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through files
The second line of code should be:
FName = Dir(FileDir & "*.xls") to open XLS files only. -- Jim Rech Excel MVP "Jim Rech" wrote in message ... | As a start... | | Sub ProcessFiles() | Dim FileDir As String | Dim FName As String | Application.ScreenUpdating = False | FileDir = "C:\Files\" | FName = Dir(FileDir) | Do Until FName = "" | Workbooks.Open FileDir & FName, False, True | ''Add extracting code... | ActiveWorkbook.Close False | FName = Dir() | Loop | End Sub | | -- | Jim Rech | Excel MVP | "Newbie" wrote in message | ... || Hi, || || I need to loop through all the files in a directory to extract data from a || specific cell but without naming the files explicitly. || || Can anyone help please? | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Loop through all files in a folder | Excel Programming | |||
Loop through files | Excel Programming | |||
Counting files using Loop | Excel Programming | |||
Counting files using Loop | Excel Programming | |||
Counting files using Loop | Excel Programming |