View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default Macro to open, calculate, the save many files.

Something like

Dim aryNames
Dim i As Long

aryNames = Array("File1.xls", "File2.xls", "File3.xls", _
"File4.xls")
For i = LBound(aryNames) To UBound(aryNames)
Workbooks.Open aryNames(i)
'your code
ActiveWorkbook.Close savechanges:=False
Next i


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"msdrolf" wrote in message
...
I would like to open, calculate, then close about 200 plus files. The

files
are too large to open at once. I need to open one file, calculate, then
close it before opening the next file. The file names are in column A,

the
path is the same for all files. I am guessing this involves an "array".
Unfortunately I haven't yet learned to work with arrays. Hope somebody

can
help me. Thanks.