Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy worsheet from different files in to one file
Hi,
The situation is, I have 25 excel files in my C:/ drive. I need to copy first worksheet named as "Fullrecon" from all 25 excel files into one excel file. In the new file, the data from the 25 excel sheets should come in one single worksheet. In other words if each of 25 excel sheets contain 100 rows then the final excel sheets should contain 2500 rows. This task is very important for me. I am not so good at coding. Please help me achieve this. Thanks a lot for the help. Thanks Boss |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy worsheet from different files in to one file
Sub combine()
Folder = "c:\temp" First = True Do If First = True Then FName = Dir(Folder & "\*.xls") First = False Else FName = Dir() End If If FName < "" Then Workbooks.Open Filename:=Folder & "\" & FName Set newbk = ActiveWorkbook With ThisWorkbook.ActiveSheet LastRow = .Range("A" & Rows.Count).End(xlUp).Row NewRow = LastRow + 1 End With With newbk.Sheets("Fullrecon") NewLastRow = .Range("A" & Rows.Count).End(xlUp).Row .Rows("1:" & NewLastRow).Copy _ Destination:=ThisWorkbook.ActiveSheet.Rows(NewRow) End With newbk.Close End If Loop While FName < "" End Sub "Boss" wrote: Hi, The situation is, I have 25 excel files in my C:/ drive. I need to copy first worksheet named as "Fullrecon" from all 25 excel files into one excel file. In the new file, the data from the 25 excel sheets should come in one single worksheet. In other words if each of 25 excel sheets contain 100 rows then the final excel sheets should contain 2500 rows. This task is very important for me. I am not so good at coding. Please help me achieve this. Thanks a lot for the help. Thanks Boss |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy worsheet from different files in to one file | Excel Programming | |||
Enter data in one worksheet and have it copy to another worsheet | Excel Discussion (Misc queries) | |||
Divide worsheet and save as separate files | Excel Worksheet Functions | |||
Trouble saving a worsheet to a file using macros. | Excel Programming | |||
Copy a range from different worksheets and place in another worsheet | Excel Programming |