Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Information building?

I want to have my the spreadsheet I open automatically open all workbooks in
a directory. And copy the information from cell b2 into the current
workbook. The only problem is that this directory will be added to and also
client deleted as they come and go.

currently we have 40 patients

so that will be 40 workbooks in the directory c:\idsc\clients\

The sheet name for all books is called "hidden info"

and the workbook it will be pasted into is called chart database

Thanks if anyone can help with this

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Information building?

Here is some code as a starter

Dim aryFiles
Dim oFSO

Sub LoopFolders()
Dim i As Integer

Set oFSO = CreateObject("Scripting.FileSystemObject")

selectFiles "c:\MyTest"

Set oFSO = Nothing

End Sub


'---------------------------------------------------------------------------
Sub selectFiles(sPath)
'---------------------------------------------------------------------------
Dim Folder As Object
Dim Files As Object
Dim file As Object
Dim fldr
Dim iRow as Long

Set Folder = oFSO.GetFolder(sPath)

For Each fldr In Folder.Subfolders
selectFiles fldr.Path
Next fldr

i= 1
For Each file In Folder.Files
If file.Type = "Microsoft Excel Worksheet" Then
Open Filename:=file.Path
Workbooks.("chart
database.xls").Worksheets("data").Cells(i,"A").Val ue = _
Workbooks(Activeworkbook.Worksheets("hidden
info").Range("B2").Value
i = i + 1
End If
Next file

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Greg B" wrote in message
...
I want to have my the spreadsheet I open automatically open all workbooks

in
a directory. And copy the information from cell b2 into the current
workbook. The only problem is that this directory will be added to and

also
client deleted as they come and go.

currently we have 40 patients

so that will be 40 workbooks in the directory c:\idsc\clients\

The sheet name for all books is called "hidden info"

and the workbook it will be pasted into is called chart database

Thanks if anyone can help with this

Greg




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Information building?

OPENING a long list of files could be time consuming. As an alternative you
might want to explore linking cells in your "master" sheet to the "hidden"
sheets

or looping thru each with Data Get External Data which does not require
opening the workbooks.

"Greg B" wrote:

I want to have my the spreadsheet I open automatically open all workbooks in
a directory. And copy the information from cell b2 into the current
workbook. The only problem is that this directory will be added to and also
client deleted as they come and go.

currently we have 40 patients

so that will be 40 workbooks in the directory c:\idsc\clients\

The sheet name for all books is called "hidden info"

and the workbook it will be pasted into is called chart database

Thanks if anyone can help with this

Greg



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table cutting information of a part of the information ASR Excel Discussion (Misc queries) 1 November 5th 09 02:09 PM
Building a TOC phil1ray Excel Discussion (Misc queries) 2 February 10th 06 02:46 PM
building a web site Paul Charts and Charting in Excel 0 January 27th 06 01:26 AM
building xsl for an xml venk Excel Programming 0 January 7th 05 07:31 PM
Building xll No Name Excel Programming 2 February 28th 04 06:25 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"