Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have a folder with a changing number of status reports in it. Each is standardized and only contains one tab, "Status Report". Each status report has a cell (always B10) categorizing what type it is. I then have a "Infra Crit Master" that originally will have one tab "Summary" also in the folder. What I would like is every time the master file is opened, it will search the folder for workbooks where B10 = True on the "Status Report" tab. It will then make a copy of that worksheet and place this worksheet after "Summary" in "Infra Crit Proj." I'm not proficient at VB and cobbled together this piece of code from other topics: Private Sub Workbook_Open() Dim i As Integer, wb As Workbook With Application.FileSearch .NewSearch .LookIn = "\\lm-intm-01\clientdata$\n0148234\Desktop\Status Report" .SearchSubFolders = False .Filename = "*.xls" .Execute For i = 1 To .FoundFiles.Count Set wb = Workbooks.Open(Filename:=.FoundFiles(i)) If (wb.Worksheets("Status Report").Range("B10") = "TRUE") Then wb.Worksheets("Status Report").copy After:=Workbooks("Infra Crit Proj").Sheets("Summary") End If Next i End With End Sub I understand most of it, but get lost at the actual copying part, not sure of any of the conventions for refering to workbooks, worksheets, etc. Suffice to say it doesn't work. Any help would be greatly appreciated. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2 Workbooks and 6 Worksheets - Need to Populate 1 Workbook | Excel Worksheet Functions | |||
How to merge monthly workbooks into a quarterly workbook?? | Excel Worksheet Functions | |||
Macro to open workbook and copy and paste values in to orig workbo | Excel Worksheet Functions | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Weekly Transaction Processing | Excel Worksheet Functions |