Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a file with about 200 Excel workbooks. Each workbook has 2 sheets. I
need to total up the values from cell "X12" on sheet2 for all 200 workbooks. Each workbook has a different name. Is it possible to do this in a new excel sheet? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put this macro into a new workbook. Change the FOLDER as required (from
c:\temp) Sub GetX12() Folder = "c:\temp\" Set SumSht = ActiveSheet RowCount = 1 FName = Dir(Folder & "*.xls") Do While FName < "" Set OldBk = Workbooks.Open(Filename:=Folder & FName) SumSht.Range("A" & RowCount) = FName SumSht.Range("B" & RowCount) = OldBk.Sheets("Sheet2").Range("X12") RowCount = RowCount + 1 OldBk.Close savechanges:=False FName = Dir() Loop End Sub "Gluefoot" wrote: I have a file with about 200 Excel workbooks. Each workbook has 2 sheets. I need to total up the values from cell "X12" on sheet2 for all 200 workbooks. Each workbook has a different name. Is it possible to do this in a new excel sheet? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This worked perfectly. And it was my first experience creating a macro. Thank
you so much! "joel" wrote: Put this macro into a new workbook. Change the FOLDER as required (from c:\temp) Sub GetX12() Folder = "c:\temp\" Set SumSht = ActiveSheet RowCount = 1 FName = Dir(Folder & "*.xls") Do While FName < "" Set OldBk = Workbooks.Open(Filename:=Folder & FName) SumSht.Range("A" & RowCount) = FName SumSht.Range("B" & RowCount) = OldBk.Sheets("Sheet2").Range("X12") RowCount = RowCount + 1 OldBk.Close savechanges:=False FName = Dir() Loop End Sub "Gluefoot" wrote: I have a file with about 200 Excel workbooks. Each workbook has 2 sheets. I need to total up the values from cell "X12" on sheet2 for all 200 workbooks. Each workbook has a different name. Is it possible to do this in a new excel sheet? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You didn't create the macro, you just ran it!
"Gluefoot" wrote: This worked perfectly. And it was my first experience creating a macro. Thank you so much! "joel" wrote: Put this macro into a new workbook. Change the FOLDER as required (from c:\temp) Sub GetX12() Folder = "c:\temp\" Set SumSht = ActiveSheet RowCount = 1 FName = Dir(Folder & "*.xls") Do While FName < "" Set OldBk = Workbooks.Open(Filename:=Folder & FName) SumSht.Range("A" & RowCount) = FName SumSht.Range("B" & RowCount) = OldBk.Sheets("Sheet2").Range("X12") RowCount = RowCount + 1 OldBk.Close savechanges:=False FName = Dir() Loop End Sub "Gluefoot" wrote: I have a file with about 200 Excel workbooks. Each workbook has 2 sheets. I need to total up the values from cell "X12" on sheet2 for all 200 workbooks. Each workbook has a different name. Is it possible to do this in a new excel sheet? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
maybe you can help me out joel.
"joel" wrote: Put this macro into a new workbook. Change the FOLDER as required (from c:\temp) Sub GetX12() Folder = "c:\temp\" Set SumSht = ActiveSheet RowCount = 1 FName = Dir(Folder & "*.xls") Do While FName < "" Set OldBk = Workbooks.Open(Filename:=Folder & FName) SumSht.Range("A" & RowCount) = FName SumSht.Range("B" & RowCount) = OldBk.Sheets("Sheet2").Range("X12") RowCount = RowCount + 1 OldBk.Close savechanges:=False FName = Dir() Loop End Sub "Gluefoot" wrote: I have a file with about 200 Excel workbooks. Each workbook has 2 sheets. I need to total up the values from cell "X12" on sheet2 for all 200 workbooks. Each workbook has a different name. Is it possible to do this in a new excel sheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I pull data from multiple user workbooks into one? | Excel Discussion (Misc queries) | |||
pull data for a company with data in diff cells multiple wrkshts | Excel Worksheet Functions | |||
Pull multiple data | Excel Worksheet Functions | |||
Data from closed workbooks (pull func, indirect.ext, etc ....) | Excel Worksheet Functions | |||
How do I pull in multiple data sets at once? | Excel Discussion (Misc queries) |