![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 1
|
I would like to have a summary workbook which calculates totals from several files in the same directory.
Ive got this working fine but what i would like is if a new workbook is added to the directory the summary workbook would add this workbook to its calculations. all the workbooks will have the same format. perhaps there is a much better way of doing this. thanks greg |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following:
Code:
Dim fs, f, f1, fc, i
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("C:My Documents")
Set fc = f.Files
For Each f1 In fc
i = i + 1
Worksheets("Summary").Range("A" & i).Value = f1.name
Next
Be aware that a single slash on this message board is represented by a double slash (don't ask me why). _________________ Hope this helps. Kind regards, Al. [ This Message was edited by: Al Chara on 2002-04-15 09:08 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|