Excel READ FOLDER



techstore
LQ Net Home




























   Excel Links

Reading through files in a folder

printpage    Printer Friendly Page

This code allows the user to read through a folder and process the files that match the criteria.
The dir command will read through the folder given as a parameter.
You can also specify a file extension, a file name or a wildcard in order to restrict which files in the folder are selected.


Dim mfile as String
Dim wkb as Excel.Workbook

mfile = Dir(c:\folder1\ + "JV1*.xls")
Do While mfile <> ""
Set wkb = Workbooks.Open FileName:=mfile
Call processJV1
wkb.Close SaveChanges:=False
mfile = Dir
Loop

MsgBox "Processing is complete "























   Today's News





Office Depot, Inc

Tech Depot - An Office Depot Co.



Overstock.com, Inc.

























Copyright © 2006-2008, LQ Systems,Inc. All rights reserved.