J
John Kitchens
Okay,
You guys have helped me in the past, and I need you again.
I am using Excel 2000.
I have a worksheet that I saved as a template. The user opens the template
and clicks a button that executes the macro.
When the button is pushed the open box appears and you select the files that
you need and hit open and then it opens the files one after anpther.
When it finishes opening the files (up to 250) I click on the first page of
my workbook "Summary". These is where is all the information is summarized
from all of the 250 or so files that are now open in the workbook.
I save this new file as DS092204 for daily summary and the date. Same thing
tommorrow DS092304.
NOW MY QUESTION
I would like to use this same form and modify the macro so that instead of
opening all 250 individual files I could just open the DS files and create a
weekly summary. I can use this macro now to open the DS files, but all of
the files (up to 250) that were used to create the DS open with it. That is
too much and it takes to long. I also get the message about linked data
etc. that I have to say ok to for it to continue with its calculation.
I am hoping to modify this macro so that it will only open sheet one or in
my case "Summary" of the DS files and then compute based on that
information. I am not sure if this can be done or not since the Summary
sheet of the DS files are calculated by having the 250 files open.
This is the macro that creates the daily summary:
Sub GetSheets()
Dim i As Long
Dim varr As Variant
Dim wkbk As Workbook
Dim ws As Worksheet
Application.DisplayAlerts = False
varr = Application.GetOpenFilename(filefilter:="Excel Files, *.xls", _
MultiSelect:=True)
If IsArray(varr) Then
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(varr(i))
Set ws = wkbk.Sheets("Sheet1")
ws.Unprotect
ws.Name = Left(wkbk.Name, Len(wkbk.Name) - 4)
ws.Cells.Style = "Normal"
ws.DrawingObjects.Delete
ws.Copy After:=ThisWorkbook.Worksheets("Start")
wkbk.Close SaveChanges:=False
Next
End If
Application.DisplayAlerts = True
End Sub
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Visible = xlSheetVisible
Next ws
End Sub
I am sorry this post is so long. Can someone please help?
John Kitchens
You guys have helped me in the past, and I need you again.
I am using Excel 2000.
I have a worksheet that I saved as a template. The user opens the template
and clicks a button that executes the macro.
When the button is pushed the open box appears and you select the files that
you need and hit open and then it opens the files one after anpther.
When it finishes opening the files (up to 250) I click on the first page of
my workbook "Summary". These is where is all the information is summarized
from all of the 250 or so files that are now open in the workbook.
I save this new file as DS092204 for daily summary and the date. Same thing
tommorrow DS092304.
NOW MY QUESTION
I would like to use this same form and modify the macro so that instead of
opening all 250 individual files I could just open the DS files and create a
weekly summary. I can use this macro now to open the DS files, but all of
the files (up to 250) that were used to create the DS open with it. That is
too much and it takes to long. I also get the message about linked data
etc. that I have to say ok to for it to continue with its calculation.
I am hoping to modify this macro so that it will only open sheet one or in
my case "Summary" of the DS files and then compute based on that
information. I am not sure if this can be done or not since the Summary
sheet of the DS files are calculated by having the 250 files open.
This is the macro that creates the daily summary:
Sub GetSheets()
Dim i As Long
Dim varr As Variant
Dim wkbk As Workbook
Dim ws As Worksheet
Application.DisplayAlerts = False
varr = Application.GetOpenFilename(filefilter:="Excel Files, *.xls", _
MultiSelect:=True)
If IsArray(varr) Then
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(varr(i))
Set ws = wkbk.Sheets("Sheet1")
ws.Unprotect
ws.Name = Left(wkbk.Name, Len(wkbk.Name) - 4)
ws.Cells.Style = "Normal"
ws.DrawingObjects.Delete
ws.Copy After:=ThisWorkbook.Worksheets("Start")
wkbk.Close SaveChanges:=False
Next
End If
Application.DisplayAlerts = True
End Sub
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Visible = xlSheetVisible
Next ws
End Sub
I am sorry this post is so long. Can someone please help?
John Kitchens